Democratic state lawmakers in Virginia are trying to push a first-time candidate out of a primary contest for a House of Delegates seat after learning he made sexist and racist online comments.

House Democratic leaders took the rare step last week of asking Tom Brock of Virginia Beach to step aside, saying they need to hold their own accountable, especially after months of bashing President Trump for insensitivity toward women and minorities.

Brock has repeatedly apologized for Facebook posts between 2010 and 2016 but refuses to end his campaign. He said his posts are being blown out of proportion. “I absolutely reject the claims of racism that are being thrown around,” Brock wrote on his Facebook page Tuesday.

House Minority Leader David J. Toscano (D-Charlottesville) called Brock to ask him to drop out in March, shortly after Brock emailed party officials to apologize for insensitive posts about women that surfaced. In those posts, he made lewd remarks about 2012 GOP presidential candidate Mitt Romney and described Jenna Bush Hager as a “slut” in response to an article in which she mentioned she may have kissed her now-husband on the White House roof.

Then, a 2011 Facebook exchange surfaced in which Brock posted racist jokes.

“Q: Why do kids prefer white teachers over black teachers? A: It is easier to bring an apple than a watermelon,” Brock posted in a 2011 Facebook exchange with his son, according to an image provided to the House Democratic Caucus.

When his son set up a joke asking why blind musician Stevie Wonder can’t read, Brock responded “cause he’s BL......ACK!!!!”

“In this era with Donald Trump being the president and everything that’s happened, it’s more important than ever that candidates for higher office set a higher standard,” said Jennifer B. Boysko (D-Fairfax), the finance chair of Democratic House leadership. “We are not willing to be contributing to the normalization of mocking women and minorities, even if it’s in our own party.”

The dispute is revealing the messy side of what Virginia Democrats are hoping will be a wave election in 2017, thanks to a record number of candidates from their party and a surge of civic interest since Trump’s election.

It also shows how the state Democratic Party has little margin of error in its goal to gain control of the House, where Republicans hold a 66-to-34 majority.

The district in question, spanning Chesapeake and Virginia Beach and represented by Ronald A. Villanueva (R-Virginia Beach), is one of 17 carried by Hillary Clinton in November. If Democrats pull off a sweep of all 17 districts and do not lose any seats they occupy, they win control of the House.

Brock said he regrets the posts, and they are unacceptable no matter the context.

Brock says the exchange came as he and his adult son were reminiscing about a decade-old ski trip, where he scolded him for making racist jokes.

“We should hold each other accountable, but I don’t think we have to become so hyperbolic about it and treat it in a way that potentially ruins someone’s reputation and can actually get into their life,” said Brock, a 48-year-old systems administrator.

The House Democratic Caucus publicly endorsed Brock’s primary challenger, Kelly Fowler.

Fowler, a real estate agent, says she was inspired to run after participating in the Women’s March on Washington. Brock is a fan of Sen. Bernie Sanders (I-Vt.), who co-founded a group encouraging progressive candidates to run for state legislative seats.

Since the controversy over his Facebook posts erupted, Brock took to the liberal Daily Kos website to blog about how he started to grapple with racial issues.

“I never considered myself racist, but I also didn’t have a complete grasp on the disparity between races until all of the instances of young black men being gunned down by police started to get wide attention,” Brock wrote. “I was convinced that President Obama was going to do something about it, but there was never a strong response from him.”

That has further irked Democratic leaders, who say the comments suggest that Brock is trying to blame the nation’s first black president for his own racism.

“We have an enormous amount of energy focused on pushing back against the Trump agenda and the things Trump has said,” said Del. Lamont Bagby (D-Henrico), who is vice chair of the Legislative Black Caucus. “It’s very difficult for us to push back on some of the things he has said while we have a candidate that has said some things also not representative of our party, our country and our commonwealth.”

Brock said the reaction from party leaders will discourage activists who want to get involved in politics. He says he is not the only one who has made stupid comments, and he is sure Democratic lawmakers already in the legislature have had their share of offensive remarks.

“I’m a new candidate, this is my first time running, and I am trying to do the right thing,” Brock said. “They are telling people that if you run, this is what we will do to you.”