When Jerry Rawlings, who has dominated national life here for the past 20 years, peacefully handed over power to the elected opposition candidate in January, Ghana's democratic transition was widely hailed as a model for the rest of Africa, where longtime leaders seldom leave power gracefully.

But now, almost six months later, the country is finding out just how difficult and complex such a transition can be. And Rawlings, a former flight lieutenant who led two military coups and won elections in 1992 and 1996, continues to cast a long shadow over the political landscape.

The constant sniping between Rawlings and the new government of President John Kufuor has kept this West African country of 18 million people on edge and has undermined the climate of stability and national reconciliation that both men promised during the transition.

With no precedent in Ghana's 44 years of independence of a ruling party ceding power to a duly elected opposition, both parties are adjusting to new roles. But with Ghana carrying $6 billion in foreign debt and prices for its main exports of cocoa and gold still low, the jockeying has slowed badly needed economic reforms and kept foreign investors at bay, according to analysts and diplomats.

Rawlings, flamboyant leader of the National Democratic Congress (NDC) and darling of Africa's socialist revolutionaries before embracing free-market reforms in the mid-1980s, has never been in the legal opposition before.

And Kufuor, a reserved, British-educated lawyer and businessman who leads the New Patriotic Party, has never before held power.

The challenge for Kufuor, said E. Gyimah-Boadi, director of the Center for Democracy and Development here, is how to deal with "the perceived threat Rawlings presents to the regime. He twice led successful coups, is an inveterate rabble-rouser and populist, and you can't help but take him seriously."

On the other side, Gyimah-Boadi said, is a party that "has been out of power for 30 years, with a lot of people who feel that now is their chance" to exact revenge for abuses during the Rawlings years and "cut Rawlings down to size."

As it left office, the Rawlings government enraged people by allotting many of its members generous "end-of-service benefits" that cost the government millions of dollars. NDC legislators, many of whom were reelected and not retiring, were among those who received the largess. Many NDC officials were also allowed to buy government vehicles at less than 30 percent of their market value and given other perks.

"Ghanaians are not at all amused at what many consider to be a last-minute raid on the public treasury by a government that has left a legacy of red on Ghana's books without leaving behind assets or investments of equal value," said H. Kwasi Prempeh of the Center for Democracy and Development.

And many people here are upset that the government will continue to provide Rawlings with a house and security detail. He has, however, lost his access to air force jets he could once fly at will.

The most serious clash began June 4, when Rawlings, celebrating the anniversary of his 1979 takeover, gave a speech implying that Kufuor did not have the confidence of the military, a claim that was widely interpreted as being the threat of another coup. One of Kufuor's first acts was to abolish the national holidays marking that date and the anniversary of the second coup, Dec. 31, 1981, which ushered in the Rawlings era.

But in response to Rawlings's speech, the military leadership pledged its loyalty to the government.

"The former president has benefited from being a coup leader, and I am not surprised he looks at the situation with nostalgia," said Kwame Addo-Kufuor, the defense minister and the president's brother, in an interview. "But that nostalgia is not shared by most Ghanaians or the Ghanaian military."

Diplomats who follow the military said that, while Rawlings has pockets of support, there is no indication of a military plot.

But the speech and response sparked a furor here, culminating earlier this month with several dozen soldiers and police officers surrounding Rawlings's housing compound and searching for hidden weapons.

In response, the NDC leadership sent a sharply worded letter to Kufuor. "Your government, by its actions, is almost justifying the unconstitutional behavior of some African heads of state who would not want to leave office at the end of their tenures," it said. "For after all, who would want to quietly and smoothly hand over power if the reward is harassment, intimidation, embarrassment and even imprisonment without justifiable cause?"

The Kufuor government has also launched investigations into alleged corruption during the Rawlings years. But analysts and diplomats point out that the president has yet to fulfill his campaign promise to make his financial interests public or institute serious conflict-of-interest rules for senior government officials.

Diplomats and observers said that while Rawlings has been provocative, Kufuor's harsh counterattacks may be intended to distract attention from the unpopular economic measures he has taken, such as raising fuel prices by 64 percent and doubling the prices of electricity and water.

"Kufuor does not have a lot to offer the people in terms of food," said Yao Graham, a political analyst, "so he has to let the circus run."

A veteran diplomat here described growing international unease over the attacks on Rawlings, saying that "Kufuor promised reconciliation but some elements of the party want to destroy Rawlings, and that is a very worrisome trend."

The tensions are likely to remain high. Kufuor has authorized the formation of a South Africa-style truth commission to investigate human rights abuses under the Rawlings governments. The constitution grants amnesty for the abuses, which included the execution of three former heads of state on corruption charges, but proponents of the commission say it is necessary for national healing.

Rawlings's supporters argue that any commission should also investigate the pre-Rawlings regimes, notorious for being corrupt.

"That will be a very delicate time," said one diplomat. "In theory it is a good thing, but the question is: Can Ghana handle it?"

Longtime leader Jerry Rawlings, limited by Ghana's constitution to two terms as president, cast his ballot in December in Accra. He turned over power peacefully to John Kufuor, who addressed an audience at his inauguration in January.