Mayor Marty Walsh won’t be supporting a candidate before the primary election for governor, but he plans to support the Democrat who comes out on top, despite a close personal relationship with Gov. Charlie Baker.

“I’m a Democrat, and I’ll be with the Democrat,” Walsh said during an interview Friday with Boston Public Radio. “I get along — I love the governor, he’s a friend … [but] I’ll be with the Democratic candidate in the final.”

Walsh told BPR he met Friday with former Newton Mayor and candidate for governor Setti Warren, and he plans to meet with the other candidates within the next few weeks.

Walsh also said he plans to announce his endorsement for a candidate in the race for Rep. Michael Capuano’s seat, a contest between two progressive Democratic candidates who he has supported and who have supported him: long-time incumbent Capuano and City Councilor Ayanna Pressley.

“At some point I’ll endorse,” Walsh said. “It’s an interesting race. I’ve known Mike Capuano for a long time. When Mike ran for U.S. Senate, I supported his candidacy ... and then in 2013, Mike supported me for Mayor. I’ve worked with Ayanna Pressley for the last bunch of years and I supported her when she ran for City Council, I think her second term.”

"It’s a tough call,” he continued. “It’s a tough race, because you have two progressive Democrats running against each other, that I think — [Capuano] said this — they’ll probably vote the same on every single issue, and it makes it difficult. Generally, you don’t see that, progressives running against progressives.”

The primary election will be held Sept. 4.