Former Michigan state lawmaker Rashida Tlaib is set to become the first Muslim woman elected to Congress after winning the Democratic primary on Tuesday for a House seat in the state.

Tlaib will run unopposed in the general election in November, with no Republicans on the ballot in the overwhelmingly Democratic district in and around Detroit.

Tlaib is set to replace John Conyers, the longtime congressman who stepped down in December amid accusations he sexually harassed former staffers.

“Thank you so much for making this unbelievable moment possible,” Tlaib said on Twitter early on Wednesday morning. “I am at a loss for words. I cannot wait to serve you in Congress.”

Tlaib, 42, is a Detroit native. She is the daughter of Palestinian immigrants and the oldest of fourteen children.

She served in the Michigan state house from 2009 to 2014, and was also the first Muslim woman ever elected to the state’s legislature.

Conyers, 89, held Michigan’s 13th district seat for more than five decades and became the longest-serving member of Congress before his resignation late last year. He stepped down under pressure from fellow Democrats after multiple women who used to work for him accused him of harassment, allegations that he denied.

Tlaib won the primary against a field of five other candidates, including Brenda Jones, the Detroit city council president, and Conyers’ great-nephewIan Conyers.

Tlaib has said her decision to run was prompted by increasing attacks against American Muslims and immigrants since Donald Trump was elected.

“I didn’t run because my election would be historic,” she told ABC News last week. “I ran because of injustices and because of my boys, who are questioning their [Muslim] identity and whether they belong. I’ve never been one to stand on the sidelines.”

“When you see a Palestinian person with your name and faith succeed, it shows [the government] can ban us from coming into the country, but not from getting elected,” Tlaib added. “Showing people it can be done would be a victory to my family.”

There are two Muslim American men serving in the House, Democrats Keith Ellison of Minnesota and Andre Carson of Indiana, but no women.

Tlaib, a mom of two and the first in her family to go to college, ran to the left of the rest of the Democratic field and secured the endorsements of several national progressive groups.

She was among a dozen protesters who disrupted a speech by Trump at the Detroit Economic Club during the 2016 campaign, writing in an op-ed in the Detroit Free Press that despite criticism it was “unbecoming” behavior for a former state legislator, she concluded that “confronting Trump was the most patriotic and courageous act I could pursue” because of his anti-immigrant and anti-Muslim rhetoric.

A separate special election to fill the last two months of Conyers’ term was still too close to call Wednesday, with Tlaib and Jones neck and neck.

Regardless of the outcome of that contest, Tlaib is expected to take the seat for a full two-year term in January.

‘‘This is a huge victory for the Arab and Muslim American communities – it’s also a huge victory for the city of Detroit,’’ Sally Howell, director of the Center for Arab American Studies at the University of Michigan-Dearborn, told the Associated Press.

‘‘Rashida Tlaib brings forward the legacy of John Conyers in terms of the groundbreaking role he played in Congress and his commitment to civil rights.’’