With all precincts reporting Wednesday morning, Swalwell held a lead of 6,332 votes. Swalwell received 74,007 votes, 52.23% of the total, vote to Stark's 67,675 votes, about 47.2%.
Stark made a brief stop at Pleasanton's United Democratic Campaign Headquarters on Stoneridge Drive around 5 p.m. but had headed to his home in Fremont by 9 p.m.
Meanwhile, Swalwell's party at the Deputy Sheriffs' Association of Alameda County offices on Owens Drive was just getting warmed up, with hundreds gathering to watch the final results.
Swalwell, an Alameda County deputy district attorney, said his victory "reflects the hard work that we put in."
"We hit about 20,000 homes in the last 10 days," Swalwell said, describing a last ditch effort that included Pleasanton, Dublin and Castro Valley. "We had over 100 volunteers just this weekend."
The two were battling over a redrawn 15th District, one of the new districts established in the statewide realignment of federal, regional and state voting districts based on the 2010 census.
Stark, 81, an outspoken liberal, served for nearly four decades in his original 9th District. He was unavailable for comment by press time.
The race took a number of turns that included criticism of Stark, a multimillionaire former banker, for allowing his minor children to collect Social Security.
Swalwell has vowed to work to close what's been described as the "rich kid loophole."
In April, Stark accused Swalwell of taking "hundreds of thousands of dollars in bribes" from a prominent real estate development family. Swalwell threatened legal action if Stark did not apologize, which he did the next day.
Both Stark and Swalwell are Democrats, but were pitted against each other due to changes in California election law that allows for voters to choose between the top two contenders, regardless of party affiliation.