GOTHENBURG, Sweden — Sweden, a country synonymous with stable government, generous welfare and liberal immigration policies, entered a new era on Monday, as its fragmented political mainstream scrambled to form a coalition government strong enough to exclude the surging far right.

Elections held Sunday gave the center-left enough votes to take power from the governing center-right alliance, yet neither bloc won a majority. But the Sweden Democrats, an anti-immigrant party, more than doubled their vote and now hold the balance of power in Parliament.

On Monday, the popular tabloid Expressen published a front page starkly displaying on a black background the number of Swedes who voted for the Sweden Democrats: more than 780,000, or almost 13 percent of the total.

Thousands of protestors gathered in Stockholm, Gothenburg and Malmo on Monday to protest against racism in reaction to the Sweden Democrats, who have roots in the white supremacist movement. “It is a sad day,” said Annie Loof, leader of the Center party.