Every working day, retiring President Fernando Belaunde Terry sallies out from the presidential palace here and inaugurates a public works project, competing in vain for attention with a campaign to elect his successor.

One afternoon last week, the president suddenly led local reporters on a walk through the colonial-style Plaza de Armas and into the center of town. The curious crowd that gathered, he announced, was the answer to the media's reports of his widespread unpopularity.

These are gestures of the last days of government for Peru's most enduring democratic politician, and they are proving as trying and embittered as Belaunde's five-year rule.

"When a government is ending, it's very hard," he said. "So this is a very unfavorable situation."

Belaunde is only three months away from completing a landmark contribution to the consolidation of Peruvian democracy. On July 28, he expects to become the first democratic president to finish his term and turn over power to an elected successor in more than 60 years.

Nevertheless, the 72-year-old political veteran finds himself as besieged by crisis and harsh public criticism in his last months as he ever has been. Strikes have crippled government finances, and foreign banks are threatening to cut off Peru's credit for failure to make loan payments.

Even as Maoist guerrillas seek to disrupt the April 14 elections, Belaunde is under attack for failing to end abuses by the military and police forces. Meanwhile, the president's candidate in the election appears to be headed for a crushing defeat, placing fourth in opinion polls with less than 6 percent of the vote.

Belaunde, who is required by law to retire, described his fortunes with a distinct air of bitterness.

"If the Peruvian people want trouble," he said of the campaign polls predicting the victory of center-left candidate Alan Garcia, "they have a democratic right to choose that."

Yet, the president has not given up his effort to demonstrate his accomplishments, and he says he is confident that he will preserve both a democratic transition and a place of prestige in Peruvian history.

"I have been here 10 years, so I am not afraid," he said. "I don't believe in catastrophic prophecies. I know the country will survive."

Belaunde reviewed his government in an interview here yesterday with Katharine Graham, the chairman of the board of The Washington Post Co., and a group of editors and reporters.

The Peruvian leader said the primary task of his administration had become laying the groundwork for policies and foreign debt negotiations that necessarily would have to be left to a new government.

"It's very hard to deal with the banks when you're going to quit office," he said. "What we're doing now is gaining time."

Even that limited task has proved difficult. Peru entered this year owing nearly $300 million in interest arrears on its $12 billion foreign debt and is now threatened with a potentially disastrous rupture of its relations with banks.

Unless the government makes regular payments to avoid falling more than 180 days behind on interest bills, Peru's loans could be designated "value impaired" by U.S. bank regulators, triggering a freeze on the short-term credit the country needs to carry out normal international trade.

Economy Minister Guillermo Garrido Lecca said in an interview that while between $80 million and $90 million in interest payments must be made between now and July, the government's available cash had dropped in the last month because of a public workers' strike and large salary increases. As a result, he said, "new measures will have to be taken to maintain our level of solvency. Particularly I'm concerned about continuing with payments abroad. There you have a very difficult dilemma." For Belaunde, the cash crunch has strengthened arguments that Peru cannot meet its huge loan obligations under their present terms and deepened an evident embitterment with the Reagan administration for its resistance to "political" solutions to debt problems.

U.S. officials, Belaunde said, "have been very pleasant and polite and friendly" but have offered "no real help. We were so helpful in past years to the United States," he said.

"They took for granted that we were a guarantee for hemispheric harmony and peace. And so we didn't get very much."

The economic and financial crisis, which began in Peru in 1982, has forced Belaunde to freeze or abandon much of the ambitious investment program he had planned for the country. An architect by training, the two-time president has conceived and launched hundreds of public works projects during his years in power, ranging from housing and schools to a 900-mile highway through the heart of the Peruvian jungle.

Despite the pressing economic and security problems, Belaunde seemed concerned above all with completing his prize projects. At the presidential palace, a long banquet room was filled with maps and scale models of apartment towers, dams and railroad tunnels.

Each day this year, the president said, he had scheduled an inaugural ceremony for one or another of his projects. Visitors to his office were invited on an impromptu trip to a local housing development, where Belaunde brushed aside security guards to greet admirers.

The defiant defense of his legacy has already led some Peruvian politicians to suggest that Belaunde is preparing to run for a third presidential term in 1990, when he will be eligible again. For now he rejects such suggestions.

"I am aware of the fact that I am 72," he said. "I do not choose to run -- not any more . . . . It's more fun to be on the outside -- to criticize."

Belaunde said that he will give his successor six months of grace.

"Just six months," he said, a trace of bitterness again in his voice. "Then we will see what they can do. This is not so easy as people believe. It's a very difficult job."