Victor Raul Haya de la Torre, 84, a founder of the leftist democratic political movement in Latin American and a major figure in Peruvian politics for a half-century, died Thursday at his home outside Lima, Peru. He had lung cancer and his condition was complicated by heart and neurological problems.

Mr. Haya was the founder of the Alianza Popular Revolicionaria Americana (the American Popular Revolutionary Alliance). The party was best known by its initials. It drew its support from the poorest sections of society and challenged the supremacy of the conservative oligarchy and its military backing in Peru. Although it never has been the party in power -- and often had been outlawed -- APRA has been a force in Peruvian politics since its founding in 1930.

Mr. Haya conceived of what became the APRA movement as something that could find roots in many Latin American countries. He organized a predecessor group in Mexico City in 1924, during the first of many periods of exile to which he was subjected by Peruvian authorities.

The first group was called the Inter-American Party, a name that reflected Mr. Haya's international orientation. While APRA was a Marxist party in its early years, it was never a communist movement. It is now distinctly closer to the center -- and more widely accepted -- than it was at its founding.

A measure of Mr. Haya's influence has been the establishment of parties seeking similar goals in Venuzuela, Costa Rica and other countries. Other representatives of the democratic left in Latin America have been Luis Munoz Marin of Puerto Rico, Romulo Betancourt of Venezuela, Jose Figueres of Costa Rica, and Juan Bosch of the Dominican Republic.

In his own country, Mr. Haya was a candidate for the presidency in 1932, 1948, and again in 1962 and 1963. His first three efforts were aborted by military coups. In the last, he lost to Fernando Belaunde Terry.

Mr. Haya stepped down shortly before his death as president of the Peruvian Constituent Assembly, which produced a constitution designed to return the country to democratic rule for the first time in more than a decade. He won that post with about 37 percent of the vote, the largest margin the APRA ever has commanded in Peru's fragmented political spectrum. He was a candidate for the presidency in elections scheduled for next May.

President Carter sent a letter of condolence to Mr. Haya's brother, Edmundo, in which he said that "advocates of democracy all over the world will mourn the passing of this great leader, who dedicated his life to the struggle of ordinary people for control over their destinies."

Mr. Haya was born in the coastal city of Trujillo on February 22, 1985. His father was a newspaper editor and the family was well off. Early in life, Mr. Haya developed an interest in the culture of the Incas, Peru's original inhabitants and throughout his political career he tried to improve the lot of the Indians and mestizoz -- persons of mixed blood -- who makes up about 90 percent of the country's population.

He first came to prominence as a student leader at San Marcos University in Lima. In 1923, the government placed itself under the spirtual protection of the Catholic Church in an effort to consolidate its position among the deeply religious people.

Mr. Haya helped lead a student strike against this policy. The university was surrounded by the military. There was shooting, and many casualties. Mr. Haya was arrested and sent into exile.

In addition to Mexico, where he started the Inter-American Party, he travelled widely in the United States and Europe. He studied at Oxford University in England and sharpened his debating skills as a member of the Oxford Union. In 1926, he visited the Soviet Union, where he met Leon Trotsky.

He did not return to Peru until he ran for president in the 1932 election. APRA had been formed two years earlier, and while Mr. Haya himself eschewed violence as a political tactic, many of his followers did not. In 1932, APRA members killed 26 army officers. The army retaliated by rounding up and massacring an estimated 6,000 APRA members.

Mr. Haya was imprisoned for 18 months. Later, he went into a second period of exile.

APRA continued to wage its struggle in Peru, where it drew its strength from the urban poor, landless farm workers, Indians and other disadvantaged groups. Its weapons included assassination incitement to riot, and the use of street gangs known as "buffaloes."

The government retaliated in kind, any chance of a reconciliation between the military and the oligarchy on the one side and APRA on the other having been lost in the terrble bloodlettings of 1932.

By 1948, when Mr. Haya made his second try for the presidency, APRA had gained such an influence over President Jose Luis Bustamante Rivero, an independent, that the military stepped in. There followed eight more years of military rule.

For the first five of those years, from 1948 to 1953, Mr. Haya was a political refugee in the Colombian Embassy in Lima. The embassy buildng was surrounded by police and army units for most of that time to prevent Mr. Haya from escaping or to capture him if he tried. In 1953 an amnesty was declared and he left the country again. He spent the next three years in Panama, Mexico and Belgium.

When he returned to Peru, Mr. Haya began to move closer to the political forces of Gen. Manuel Odria, who had ruled as president from 1948 to 1956. This alliance with a member of the military reflected the increasing moderation of the APRA movement. But when Mr. Haya was on the verge of winning the election for the presidency in 1962, the military nullified the results. In the 1963 election, Belaunde Terry won.

The military overthrew Belaunde in 1968, and has ruled the country since, although it, too, has done so with some of the same objectives that Mr. Haya has always pursued. CAPTION: Picture, VICTOR HAYA DE LA TORRE, 1962 Photo