Joao Baptista Figueiredo, 81, a Brazilian Army general who as his country's blunt-spoken president oversaw its transition from military dictatorship to civilian rule, died at his home here Dec. 24. He had heart, lung and kidney ailments.

As president from 1979 to 1985, Gen. Figueiredo sped up the transition to democracy begun by his predecessor, Gen. Ernesto Geisel, and granted amnesty to those accused or convicted of political crimes, allowing hundreds of exiles to return.

He approved political parties--except the Communist Party--to return, ending the two-party system that prevailed throughout the country's military dictatorship from 1964 to 1985. He also allowed direct elections for state governor in 1982, a move that saw some opposition figures return to political power.

Gen. Figueiredo generally was seen as a hard-liner, and many believe the movement toward democracy was inspired more by an attempt to squelch the growing power of various government intelligence services than anything else.

Gen. Figueiredo had led Brazil's National Intelligence Service, where most of the dictatorship-era presidents were groomed, from 1974 until he became president in 1978.

A complex man who enjoyed solving math problems in his free time, Gen. Figueiredo had a deep-rooted dislike of politics and politicians and a penchant for saying the unexpected. When asked, at the end of his term, what his lasting legacy would be, he replied, "I hope I am forgotten."

Asked once whether he liked the smell of the crowds that greeted him, he retorted: "I prefer the smell of horses."

He had a heart attack during his term and underwent surgery in the United States. When he regained consciousness, his first words were reputed to have been: "How are my horses?"

He also once said, "The biggest mistake of the [1964] revolution was to make me president, because I'm responsible for this opening which I thought would lead to a full-scale democracy."

Gen. Figueiredo said that he never wanted to be president but that the army pressured him into accepting the nomination as the successor to Geisel. He said he was a bad choice.

Although his stewardship of Brazil's return to democracy is probably his greatest achievement, Gen. Figueiredo was more proud of some of his showcase economic developments, like the world's largest dam, at Itaipu.

From the day he left the government on March 15, 1985, he was virtually forgotten as he isolated himself at his private property outside Rio de Janeiro, content to indulge in his favorite hobby, horse riding.

The mantle of power was thrust on him in 1979 by his mentor, Geisel, who nominated the former cavalry general as his candidate for electoral college elections to choose his successor. Gen. Figueiredo won comfortably.

Plucked from a comfortable niche as head of the feared military security arm (the euphemistically named National Information Service), Gen. Figueiredo, who played an active part in the 1964 coup as a lieutenant colonel, doffed his uniform and sinister dark glasses to play a benign politician.

He steadfastly adhered to Geisel's policy of allowing a return to open politics. Gen. Figueiredo refused, unlike his four military predecessors, to name a successor. Tancredo Neves, leader of the opposition Democratic Movement Party, won the January 1985 election but died before he could take office. The vice president, Jose Sarney, became president.

Gen. Figueiredo had pledged to uphold the constitution, in which the architects of the 1964 coup had enshrined the provision that future presidents be elected indirectly by an electoral college. But he often appeared to waver in his resolve.

Although he never went as far as allowing direct elections, he began the process of returning Brazil to democracy by lifting censorship, releasing political prisoners and allowing those in exile to return. Direct elections were not restored until 1989.

Brazilian President Fernando Henrique Cardoso declared three days of mourning for Gen. Figueiredo.

Joao Batista Oliveira de Figueiredo was born into a military family in Rio de Janeiro. He followed his father, also a general, into the cavalry. Two of his brothers also became generals. His father was an outspoken defender of constitutional principles whose career suffered as a consequence during the Getulio Vargas dictatorship in the 1930s.

The general's survivors include his wife, Dulce, of Rio de Janeiro; and two sons, both of whom went into business rather than the army.