Dobrica Cosic, a nationalist writer who served briefly as Yugoslavia's president as the country unraveled in civil war, died Sunday, his family said. He was 92.

A former communist-turned-nationalist, Cosic was one of the most influential figures in 20th century Serbia. He played an important role in the rise of Serbian nationalism in 1980s, leading to the bloody breakup of the former Yugoslavia.

Cosic joined the communist guerrilla resistance during the German occupation in World War II and became a government official in charge of propaganda after the war. At the time, Cosic had close ties with Yugoslav dictator Josip Tito.

In the 1960s, Cosic moved away from communism toward a more nationalist position. He was among the first intellectuals in Serbia who raised complaints about the status of Serbs within Yugoslavia, particularly in the ethnic Albanian-dominated province of Kosovo.

He served as president in 1992-1993 as most of the collapsing federation's nations had already declared independence, leaving only Serbia and Montenegro within Yugoslavia.

The transformation from a communist to a nationalist was also visible in Cosic's literary work: Gradually, he switched from novels about World War II — such as "Distant Is the Sun," from 1951 — to works concentrating more on the Serbian way of living or war heroism, as was the case with the immensely popular trilogy "A Time of Death," from the 1970s.

After Tito died in 1980, Cosic was active in campaigning for Serb rights in multiethnic Yugoslavia. He was known among supporters as the "father of the nation" for his proclaimed backing for the Serb cause.

His support was important in the rise to power of Serbian nationalist leader Slobodan Milosevic. Liberal Serbs saw Cosic as one of the key people behind the Greater Serbia project — an idea pushed forward by the Serbian nationalists who wanted to unite Serbia with Serb-populated areas of Croatia and Bosnia.

Cosic turned against Milosevic shortly before his ouster in 2000 by a popular uprising led by pro-Western reformists. In a recent interview, Cosic said the nation should give up on Kosovo, which declared independence in 2008, a move Serbia has refused to recognize.

"New generations should waste no more energy on Kosovo. That issue is solved," he told Belgrade newspaper Nedeljnik.

A list of his immediate survivors was not available.

news.obits@latimes.com