Prime Minister Adolfo Suarez (left) runs to assist Deputy Prime Minister Manuel Gutierrez Mellado (center left, back to camera) during a coup attempt inside the Spanish Parliament on Feb. 23, 1981. (Manuel Hernandez de Leon/EPA)

Adolfo Suarez, who helped guide Spain from dictatorship to democracy as the first elected prime minister after the decades-long rule of Francisco Franco, died March 23 at a hospital in Madrid. He was 81.

His death was announced by a spokesman. His family disclosed nearly a decade ago that Mr. Suarez had Alzheimer’s disease and no longer remembered having been the Spanish premier. He had been hospitalized in recent days for pneumonia.

As a former functionary in Franco’s government, Mr. Suarez emerged from relative obscurity in 1976, when King Juan Carlos of Spain named him the country’s new premier. Mr. Suarez was 43 at the time and succeeded Carlos Arias Navarro, who had been the last premier to serve under Franco, and whom Juan Carlos reappointed after Franco’s death in 1975.

Having served in Franco’s government, Mr. Suarez enjoyed the trust of those on the political right. But because of his youth, he did not bear the stains carried by older politicians who had served under the generalissimo in the worst years of his dictatorship or during the bloody civil war that established Franco’s rule in 1939.

Mr. Suarez was, in short, a conciliatory figure almost ideally situated to help the young king lead the country into a new era. What he lacked in charisma he made up for in rugged good looks.

Mr. Suarez holds a press conference in Paris in 1977. (Hulton Archive/Getty Images)

“Suarez’s great gift is that he is not ideological,” an aide told The Washington Post in 1977. “He accepted the challenge and started running Spain.”

Mr. Suarez said that the government would be “the product of the free will of the Spanish people.” Over the intense objections of the military and other opponents, he oversaw the legalization of the Communist Party, which had been suppressed during the Franco era. He saw the inclusion of the left wing as critical to Spain’s integration into a modern democratic Europe.

He pieced together — “with scissors and paste,” essayist Barbara Probst Solomon once wrote in the New York Times — the Union of the Democratic Center. The coalition won a major victory in the elections of 1977, the first free elections in more than four decades.

Mr. Suarez oversaw the legalization of trade unions, supported amnesty for political offenses and sought to weaken the military’s influence on government. He was credited with helping guide enactment of the country’s 1978 constitution.

But by January 1981, amid party infighting, Mr. Suarez said his political power had “eroded” and resigned.

“No other person, during the last 150 years, has for so long democratically governed Spain,” he said in a televised speech. “But the building of a system of liberties, a new model of social coexistence, and a new model of the state, has been at the expense of my political forcefulness. I think it has been worth it. But I do not wish to see this democratic coexistence become, once again, a parenthesis in the history of Spain.”

The next month, in Mr. Suarez’s presence, armed members of the Civil Guard forced entry into the Spanish parliament and attempted a coup. Its failure was regarded as a vindication of the new democratic society.

Mr. Suarez was recognized as one of the few politicians in parliament who did not bow to the plotters’ demands.

“They ordered us to get down on the floor,” he later recalled. “I was the prime minister and the prime minister should not do that.”

Adolfo Suarez Gonzalez was born on Sept. 25, 1932, in the small town of Cebreros. His parents came from families that had worked in legal and political circles.

Mr. Suarez received a law degree from the University of Salamanca and a doctorate, with a thesis on Spanish local government, from the University of Madrid. He joined Franco’s National Movement and gradually rose through the ranks, serving in positions including regional governor of Segovia and director of state television. Mr. Suarez also was deputy secretary general of the National Movement.

After his resignation as prime minister, Mr. Suarez formed the Social Democratic Center Party, but he failed to recapture the power that he had once held. He retired in 1991 and received numerous government honors, including the title Duke of Suarez bestowed by Juan Carlos.

His wife, Maria del Amparo Illana Elortegui, whom he married in 1961, died in 2001. A daughter died in 2004. Survivors include four children.