Democrats are hoping they've narrowly avoided repeating the disaster of 2012 in retiring Rep. Gary Miller's (R-Calif.) district.

With 100 percent of precincts reporting, Redlands Mayor Pete Aguilar (D) finished second place in the primary to make the general election runoff against Republican Paul Chabot in the Democratic-leaning district. The Associated Press has not yet called the runoff spot.

But while some outstanding ballots could still remain, Aguilar's lead is very fragile. He's only leading Republican Lesli Gooch, a former Hill aide, by 390 votes. A second Democratic candidate, EMILY's List-backed Eloise Gomez Reyes, was in fourth place, but just 622 votes behind Aguilar.

Two years ago, Aguilar fell short of advancing to the general election after other Democrats siphoned off votes and Miller and another Republican took first and second place in the all-party primary, shutting Democrats out of a top pickup opportunity.

The Democratic Congressional Campaign Committee quickly rallied to Aguilar this election cycle, hoping to avoid the same fate. Reyes  and former Rep. Joe Baca (D-Calif.) decided to throw their hats into the ring as well. Democrats had been increasingly alarmed in recent days that Aguilar would once again be tripped up by the jungle primary.

If Aguilar's fragile lead holds, he'd be the favorite in the general election in the Democratic-leaning seat.