LAGUNA BEACH, Calif. — Democrats breathed sighs of relief on Wednesday as party candidates in California’s seven most competitive House races were set to advance to the general election and go on the offensive in those Republican-held districts, all of which Hillary Clinton carried in 2016.

National Democratic groups spent more than $7 million this spring as part of an extraordinary intervention to avoid being locked out of Tuesday’s “top two” California primary, in which the two leading vote-getters — regardless of party — move on to the general election this fall.

Democrats were virtually certain to secure a slot in the general election against Representative Dana Rohrabacher, a Republican, and in the Southern California districts held by Representatives Ed Royce and Darrell Issa, who are retiring.

House Democrats had staged a rescue mission in all three districts, by propping up their own favored candidates, attacking Republicans or a mix of both.