Ask D.C. Mayor Muriel E. Bowser if she encountered sexism in her rise to power, and her response is immediate: “Yes.”

“Every day. Are you kidding?” Bowser, the only woman elected to a second term as mayor of the nation’s capital, says with a chuckle. “The way to deal with them is just to work hard and to prove them wrong.”

It is among the reasons Bowser (D), 47, says she is not fazed by allegations that former New York mayor Mike Bloomberg made profane and sexist comments about women. Since endorsing Bloomberg three weeks ago, she has become one of the most energetic surrogates for the billionaire’s presidential campaign.

In a wide-ranging interview Friday, Bowser cautioned Democrats against demanding purity from candidates on issues of gender and race as they try to deny a second term in the White House to President Trump.

“We can say that we’re looking for the perfect candidate. News flash: You’re not going to find him or her,” Bowser said. “I’m not going to support a disreputable person, but I do want to make sure the person that we get behind has a program to win that’s going to cast the widest net.”

Bloomberg has surged in the polls after self-financing a massive campaign and advertising operation, despite intense criticism about his treatment of female employees and the impact of his mayoral policies on people of color.

At his first debate appearance on Wednesday, Sen. Elizabeth Warren (D-Mass.) attacked him for allegations that he called women “fat broads and horse-faced lesbians.”

Bowser demurred when asked if she would hire a man accused of making similar comments.

“I look at allegations as just that,” said Bowser. “I think what Mike has said is that he’s used crude language. And I’m pretty sure that all of us can imagine Wall Street 30 years ago, male-dominated. And I think we would all be very naive if we thought a lot of crude remarks didn’t happen.”

The mayor said she was more disturbed by a Politico report that six women of color left Warren’s campaign staff in Nevada because they felt ignored and treated like tokens. Warren apologized after the report was published, saying she believed the women.

“Now, as an African American woman who’s been in a lot of rooms, we can talk about discrimination,” Bowser said. “But one of the deadliest forms of discrimination is to be ignored and to be invisible and to not be heard.”

She did not feel ignored by Bloomberg.

They had their first conversation in 2014, she said, while Bowser was touring cities across the country after winning the Democratic primary for D.C. mayor.

Bloomberg was back at the financial terminal business that bears his name, having completed three terms as mayor of New York. Bowser recalled talking to him in the “bullpen” — the collection of cubicles where he works alongside employees — on the top floor of his tower. They found common ground on support for the education reform movement, she said. Bloomberg advised her to assemble a team of smart people who would be honest with her and challenge the status quo.

The two leaders would keep talking in the years ahead, at events for municipal officials and when Bloomberg’s Philanthropies gave $4 million to D.C. Public Schools in 2015.

Some have accused Bloomberg of essentially buying endorsements from mayors with charitable giving to their cities. It’s a criticism Bower said she has heard and pushed back against. She said his donation to local schools, while welcomed, was a sliver of the billions poured into education in the city in recent years.

“The people of Washington would be very disappointed with me if I didn’t go after free money,” Bowser said.

The mayor said she was eager to see Bloomberg make a late entry into the presidential race after another preferred candidate, Sen. Kamala D. Harris (D-Calif.), dropped out.

Both Harris and Sen. Cory Booker (D-N.J.) met with Bowser before ending their presidential bids, a political adviser to the mayor said. But of the candidates still in the running, only Bloomberg asked for her endorsement.

Bowser said she believes mayors are well-suited to lead the country, with leadership skills forged by hearing directly from constituents, especially those who are frustrated about something, and the hurly-burly of city hall politics.

“Nobody’s doing your grocery shopping. You’re not behind a six-foot fence in the White House. And so you are doing that type of negotiating with your residents, with your local elected leaders to get things done,” Bowser said. “And that’s very different than even a governor. A governor is removed in a lot of ways from that type of day-to-day interaction and getting things done.”

Bowser also commended Pete Buttigieg, whom she met at a mayoral training program sponsored by Bloomberg, for his rise from mayor of South Bend, Ind., to a top-tier presidential contender. But she said he has had “difficulty translating his small-town experience into big time.”

As a national campaign co-chair, Bowser has campaigned for Bloomberg in Virginia, Michigan and Texas and has been among his most prominent defenders on cable television.

She said she understands why many African Americans are troubled by Bloomberg’s support for a policing practice that resulted in thousands of innocent black and Latino men being repeatedly stopped and searched by police. After entering the presidential race, Bloomberg has apologized for the policy, known as “stop-and-frisk,” although he has also credited it for helping bring down a soaring murder rate.

“He can’t change history. He can only change what happens in the future,” said Bowser, describing Bloomberg’s plans to boost wealth and homeownership among blacks and in minority neighborhoods. “And I think what’s important is that a real agenda affecting those young men who were targeted by these practices is what everybody is looking for.”

The issue was on display this week as Bowser commemorated making go-go the official music of the District, an event that morphed into a broader celebration of black culture in what was once known as Chocolate City.

A protester holding a handmade sign disrupted the mayor as she spoke to reporters, demanding to know why she backs a presidential candidate who supports “systemic racism.”

“I just think it’s hypocritical to be like, ‘I’m pro-black and for the community, but not when it comes to supporting racist criminal justice policies,’ ” said Eli Nascimento, 29, who is supporting Sen. Bernie Sanders (I-Vt.) in the presidential race.

In the interview, Bowser echoed a fellow black mayor — Houston Mayor Sylvester Turner (D) — who said Bloomberg must be judged for the “totality” of his experiences and his plans.

No Democratic presidential candidate has a perfect track record on race, Bowser said. She noted both Sanders and former vice president Joe Biden voted for the 1994 crime bill, which created a federal “three-strikes” rule and offered states with tougher parole requirements money for building prisons.

“I would argue that more people are in jail because of that crime bill than stop-and-frisk,” Bowser said.

As mayor, Bowser has been a business-friendly and moderate counterbalance to an increasingly liberal D.C. Council. She has sparred with lawmakers over issues including paid family leave, reducing the influence of money in politics and decriminalizing Metro fare evasion.

On the national level, Bowser said, Democrats should be wary of having a presidential nominee from the left who wants higher taxes and nationalized health care.

“That is a tough message up against Donald Trump, who is presiding over a roaring economy,” she said. “Even if he inherited it, he’s presiding over it. And many people won’t understand how taking away their health insurance or raising their taxes is a good thing.”

Bowser also attacked Sanders and Warren for criticizing Bloomberg’s use of his vast fortune to fund his campaign, saying the left-leaning candidates are benefiting from outside groups spending on their behalf.

Bloomberg campaign officials worry Sanders will soon gain an insurmountable lead in delegates and are hoping Warren’s strong performance at Wednesday’s debate will help her eat into his base, according to Bloomberg advisers.

The District has no term limits, and Bowser hasn’t ruled out seeking a third term in 2022. But a poll conducted in the District last week increased buzz about whether she could be the rare local Washington politician with a future on the national stage.

The survey tested messages for and against Bowser as a running mate for Bloomberg, according to a recording shared with The Washington Post. Political advisers to Bowser said they did not know who was behind the poll. Bloomberg’s campaign did not return requests for comment.

Bowser sidestepped when asked if she would agree to be vetted to be vice president.

“I have the best job in Washington,” said Bowser. “And I’m here to help Mike win the nomination and defeat Donald Trump.”