President-elect Tancredo Neves died tonight after more than a month of recurrent medical crises, leaving leadership of his self-proclaimed "new republic" to a vice president who has stood in for him since Brazil's transition to civilian rule 38 days ago.

"In the last 50 years, Tancredo Neves' public life coincided with the ideals and dreams of Brazil: union, democracy, social justice and liberty," said presidential spokesman Antonio Britto, announcing Neves' death. He was 75.

A special session of Congress Monday in Brasilia is expected to declare Vice President Jose Sarney, 54, formally the president.

A month ago, when Neves still appeared to be recuperating, an apparently confident acting President Jose Sarney said in an interview that Neves' illness posed "a great opportunity to test the country's democratic institutions. And we passed with flying colors."

Now, with Neves' death, Brazil has at its helm a man who possesses little of the political experience, and even less of the popular support, once commanded by the late president-elect.

The cause of Neves' death was announced as respiratory failure, following a generalized bacterial infection that had caused a progressive collapse of vital organs and necessitated the use of artificial lung and kidney machines for almost two weeks.

Neves underwent the first of seven successive operations on the eve of his intended inauguration March 15.

A doctor in Neves' home town, Diomedes Garcia de Lima, maintained that Neves had been suffering from infections for months and had a crisis shortly before traveling to the United States to meet with President Reagan in January.

But he had kept his ill health secret and dosed himself with antibiotics, by this account, and had resisted an operation because of fears that outgoing military leaders would not hand over power to Sarney.

On Saturday, a specialist in intensive care from Massachusetts General Hospital, Warren Zapol, arrived to examine Neves and confirmed that all clinical treatment had been correct and the technical resources of Sao Paulo University Hospital excellent.

But Neves' condition was terminal.

Neves' body is to be flown to Brasilia Monday and to lie in state for two days, followed by burial in his home town in the state of Minas Gerais.

Special correspondent Mac Margolis filed this account of Sarney from Sao Paulo:

Sarney is well aware of his lack of political experience and popular support. The former governor and legislator from the dirt-poor northeastern state of Maranhao once wanted to be a poet rather than a politician.

One of 14 children, he was baptized Jose Ribamar Costa -- but took on the nickname Jose de Sarney (son of Sarney) in honor of his father, Sarney Araujo Costa. He worked as a journalist in his home state of Maranhao and in 1952 published the first of three books of poetry and prose. Soon afterwards, however, he abandoned the pen for the podium and was elected federal congressman in 1956. Sarney pursued a political career over the next three decades, switching parties three times.

As governor, between 1965 and 1970, he was known as a modernizer, and belonged to the upcoming, freer thinking generation of politicians known then as the "bossa nova" movement. He built roads, bridges and sewerage and water systems in the rudely developed backlands of Maranhao. His politics mark a sharp contrast to those of Tancredo Neves.

He opposed the government of Getulio Vargas, for whom Neves worked as justice minister in the 1950s. Later, when president Janio Quadros resigned, Sarney worked to block his succession by left-leaning vice president Joao Goulart, with whom Neves worked as prime minister. And in 1964, they parted ways again, Sarney supporting the military coup that Neves had tried unsuccessfully to quell.

A liberal among politicians of the hard right, Sarney aligned himself with the military-backed parties but opposed the dictatorship's harshest measures. More than once he helped politicians who had fallen in disfavor with the generals in Brasilia.

Until the middle of last year, Sarney was president of the military-backed Social Democratic Party. As its president, he worked first to defeat the opposition call for direct presidential elections, and then to defeat Neves' bid for president.

In one of his most personally trying moments, Sarney watched his son, also a federal congressman, vote for the constitutional amendment for presidential elections that Sarney leader had worked to defeat. But as his party bickered and finally selected an unpopular presidential candidate, Sarney grew increasingly restive and anguished. Sarney resigned and threw in his lot with the dissident group of party legislators, including former vice president Aureliano Chaves.

Neves picked Sarney as his running mate as a means to bind together this dissident bloc, now known as the Liberal Front Party. The nomination caused a stir on the left, which threatened revolt, and on the right, which went to court to try to block the advance of their "traitorous" colleague.

The Neves coalition was seen as fragile, ranging from bankers to communists. A popular version here is that the Neves government is a violin, supported by the left but played by the right. Now this instrument is in the hands of a less experienced player. And already discord has emerged.

Sarney has in recent weeks favored funding of "social impact programs," just the sort of social spending conservative Finance Minister Francisco Dornelles, Neves' nephew, has denounced as inflationary.

Sarney said in an interview that on the crucial question of Brazil's economy, he agreed with officials of the International Monetary Fund on the need for tough action against inflation. But he said his government believed that "we have a social debt that is much larger than the foreign debt."

Although all legislators support Sarney's having taken up the function of presiding, there is no consensus as to how long he should stay.

An ample constitutional change is slated for 1986 and already the popular movement for direct elections has resurfaced.

Ironically, Sarney will have to depend heavily on the support of powerful congressional leader Ulysses Guimaraes, who led the direct-elections campaign that Sarney worked so hard to crush. Guimaraes, as the presiding officer of the lower house, is next in the line of succession.