STOCKHOLM, Sweden (AP) _ After power was thrust upon him, mild-mannered Ingvar Carlsson grew into his role as prime minister and described himself as a soccer coach who molded his Social Democratic forces into a ''winning team.''

His team lost Sunday's parliamentary elections and he said he would resign today.

Carlsson, 56, had little ambition to take over as the country's leader after Prime Minister Olof Palme was assassinated in 1986. But he said he accepted out of loyalty to the party. Later, he doubted he would have taken the job had the circumstances not been so tragic.

Palme was charismatic and controversial. Carlsson has been discreet and, critics say, boring.

The national news agency TT said Carlsson is ''extraordinarily Swedish, timidly smiling, filled with a sense of responsibility and with memories from when Sweden was a poor country.''

Under his reign, the Social Democratic Party has shifted on several important issues, including applying last July for membership in the European Community and pushing through a major reform lowering the tax for high income earners.

His main political rival, the leader of the conservative Moderate Party, Carl Bildt, said Carlsson's shifts were ''a change under the gallows'' and in line with his widely respected talents as a tactician.

Support for the Social Democrats, who have dominated Swedish politics for 50 years, had started to wane when Palme was gunned down.

The assassination shocked a country where political leaders were accustomed to walking in the streets unguarded. A wave of empathy gave Carlsson enough votes in the 1988 election to form a minority government.

Last year, during the democratic upheavals in the former Soviet satellites, the party hit a 50-year low in polls. Swedes were increasingly discontent with high taxes and a swelling public sector.

Carlsson acknowledged the poor showing in the polls had been difficult to bear but believed the Social Democratic Party's well-oiled machine would bring victory at the last minute.

Party colleagues said Carlsson's strength lies in his ability to compromise and find broad solutions.

Carlsson grew up in a poor home in Boras in central Sweden. His mother, a widow, struggled as a cleaning woman and textile worker to give Ingvar and his two older brothers a decent education.

He graduated from Lund University in southern Sweden in 1958 and became assistant to the prime minister the same year.

After studying at the Northwestern University in Chicago, he was elected leader of the Social Democratic Youth Organization. The university made him an honorary doctor this year.

Carlsson became a member of parliament in 1964 and was made under secretary at the Cabinet office in 1967. Two years later, he became minister of education and cultural affairs. He held various minister's posts until he succeeded Palme.

His wife Ingrid is a librarian. They have two daughters, Ingela and Pia.