Updated at 10:36 p.m.

Conroe-based lawyer JD Lambright is the projected winner in the race for Montgomery County Attorney after preliminary results were announced by the county with all 86 precincts reporting in the Republican Primary run-off election.

Lambright earned 16,791 total votes, or 51 percent, while his opponent, Assistant County Attorney Phyllis Rainey garnered 15,995 votes, or 49 percent. The results are unofficial until they are canvassed.

"I had been expecting for a long time this would be a close race," Lambright said. "My opponent had been working in that office for many years and had broad support around. I am really looking forward to hitting the ground running soon and meeting the rest of the people in the [County Attorney's] office."

As the first few waves of reporting precincts came in, the race between Lambright and Rainey was tight, with less than 400 votes separating the two. But as the evening wore on and more precincts reported their results, Lambright began to pull away.

Lambright said the strong turnout was mainly due to voters' interest in the race between Ted Cruz and David Dewhurst for U.S. Senate. He said receiving support from the Texas Patriots PAC, who where behind Cruz in the Senate race, was a key factor in his winning.

"I'd be remiss not to say [the Texas Patriots PAC's support] was certainly helpful to me as well," Lambright said.

A total of 17,164 Republicans cast ballots during early voting last week. Because the winner runs unopposed in the November general election, Lambright will likely assume a four-year term as County Attorney beginning Jan. 1.

Lambright received 39 percent of the votes in the May 29 state Republican Primary primary, compared to 33 percent for Rainey, forcing a run-off between the two.