State Rep. Margo Davidson survived challenges Tuesday from primary opponents who cast her as too conservative for her strongly Democratic 164th District in Delaware County.

Davidson won a close race over Billy Smith, a defense lawyer from Lansdowne. A third candidate, Dafan Zhang, finished in a distant third place.

Davidson, a two-term incumbent from Upper Darby, made history when she was elected in 2010 as the first Democrat, first woman, and first African American to represent the 164th District. Changing demographics and redistricting have since made the district solidly Democratic, and Smith campaigned against Davidson's record.

"The people of the district know how hard I work for them," Davidson told a room of supporters at Casey's Saloon & Restaurant in Upper Darby after the votes were tallied.

She will face Republican Saud Siddiqui, CEO of the Upper Darby Caring Foundation, in the November election. The 164th District includes Lansdowne, East Lansdowne, Millbourne, and parts of Yeadon and Upper Darby.

Smith, 39, is a former Lansdowne Borough councilman. He ran against Davidson's votes to support school vouchers and increase restrictions on abortion clinics, casting himself as a progressive Democrat.

Smith released a statement that did not congratulate Davidson.

"We did not win the day, but we made it a real race," he said. "It is my hope that our incumbent representative heard us and will make a change in how she represents the 164th District."

Davidson, 51, defended her record throughout the campaign and called Smith's attacks unfair. She drew national media attention in 2011 when she voted to increase restrictions on abortion clinics because her cousin was one of the women killed in Kermit Gosnell's West Philadelphia clinic. She also stood by her support of school choice.

Davidson told supporters Tuesday night that attacks on her record had been an unwelcome attempt to divide Democrats in Delaware County. She thanked supporters for choosing her over Smith, referring to his campaign as backed by elitist Democrats.

"It is about the soul of the Democratic Party here in Delaware County," she said. "Is it going to be in the hands of the well-heeled elite, or is it going to be the hands of the people? I say it's going to be in the hands of the people."