Breaking centuries of isolation, Portugese-speaking Brazil has started courting its Spanish-speaking neighbors in a vigorous diplomatic campaign that may challenge U.S. influence in Latin America.

Last month, in the latest of six ground-breaking Latin forays, Brazilian President Joao Baptista Figueiredo traveled to Peru -- the first visit by a Brazilian head of state to that country, which shares a 900-mile border with Brazil.

In the last year and a half, Figueiredo has visited Venezuela and Colombia, both the first time for a Brizilian president; Paraguay; Argentina, the first time in 40 years, and Chile, the first time in 17 years. In October, he has planned a trip to Mexico, and next year to Ecuador.

With 70 percent of the Brazilian population concentrated on the Atlantic Coast, the Latin giant traditionally turned its back on the rest of the continent, preferring instead to trade along north-south lines with the United States and Europe. In a classic snub, Brazil's foreign diplomacy school did not offer classes in Spanish until recently.

But Brazil imports 85 percent of its petroleum needs and, faced with this bill, the country's leaders are now pushing exports at every turn. Each of Figueiredo's Latin trips has been accompanied by a second plane carrying up to 100 Brazilian businessmen who arrive armed with sales contracts in their attache cases.

The exporters have discovered that Latin America is a natural market for Brazilian-made cars, buses, trucks, tanks, helicopters, computers and other manufactured goods. Last year, for the first time, Brazil exported more to Latin America than it did to the United States.

"We are almost a self-sufficient continent. Our countries are complementary -- each has products that interest the other," Luis Eulali Bueno Vidigal Filho, president of the powerful Sao Paulo Federation of Industries, said when he was in Lima.

Spurring Brazil's courtship of Peru, Chile, Ecuador and Colombia is what one economist calls "Ja-panic." The Brazilians fear that the Japanese, increasingly shut out of Europe and the United States, will turn their exporting machine on Latin America's Pacific Coast. Not coincidentally, Figueiredo's visit to Peru brought a signed accord for the construction of a 1,400-mile highway that will link Brasilia and Lima, and allow Brazilians to drive to the Pacific.

Once the formal fanfare of the inaugural visits dies down, Brazilian diplomats hope that inter-American relations will develop along European lines -- frequent informal meetings as Latin leaders take advantage of the continent's improved telephone and air links.

"Increased intergration between Latin American states should not be seen as intended opposition to the U.S.," Brazilian Foreign Minister Ramiro Elysio Saraiva Guerreiro said in an interview.

But the opposite has occurred, and plans for economic intergration have been coupled with cooperation on foreign policy.

Last February, the Reagan administration dispatched Gen. Vernon A. Walters on a tour of South America in a bid to win Latin support for hard-line policies against leftist guerrillas in El Salvador. In 1965, Brazil was the only Latin nation to send troops to aid the U.S.intervention in the Dominican Republic.

This time Brazil's president gave Walters a cordial, but noncommittal reception, and later telephoned Venezuelan President Luis Herrera Campins to discuss a common policy on El Salvador. Two weeks later, while on a state visit to Columbia, Figueiredo and Colombian President Julio Turbay Ayala released a joint statement "repudiating foreign intervention in El Salvador." Later, talking to reporters, the Brazilian head of state went further, declaring: "With or without [Soviet] interference, I want to make it clear that we don't agree with military intervention in El Salvador."

Brazil opposed U.S. intervention in Nicaragua and, after the Sandinistas established firm control, extended full diplomatic relations. Last March, both countries signed a five-year energy accord.

For years, Spanish-speaking republics accused Brazil of "imperialism by proxy" for the United States, and they feared alleged territorial expansionism by the Latin giant.

But, in all the capitals he has visited, Figueiredo has been welcomed warmly.

Latin American foreign policy experts offered some explanations here recently at a conference sponsored by the Washington-based center of Brazilian studies of the Johns Hopkins School of Advanced International Studies.

"During the hard-line military government, we feared Brazilian expansion into the Amazon or the formation of a Brazil-Chile axis," said Oscar Ugarteche of the Institute of Peruvian Studies. "But the visits to the democratic countries are seen as part of the abertura [opening]," he added.

Figueiredo mixes easily in the company of democrats and dictators, and observers say this is because the president, an Army general elected by generals, has committed his presidency to restoring democracy to Brazil. Through his highly popular abertura, the president has taken controls off the press, amnestied exiles and political prisoners and scheduled elections next year for governors, mayors and congressmen.

"Figueiredo's visit was very important for improving the image of Chile, because he was the first head of state to visit since the coup," said Albert van Klaveren of the International Studies Institute of the University of Chile.

"Even with our long-term fear of Brazilian expansion, we welcome the change in foreign policy," said Rosario Green, a Mexican economist. "The Brazilians used to be 'whiter than the whites' -- there was no way to presuade them they were Third Worlders. Now they take up very good positions in international conferences," she added.

Last year, when war broke out between Iran and Iraq, temporarily cutting the source of 50 percent of Brazil's oil imports, Mexico and Venezuela stepped forward, increasing their share of Brazil's oil imports from 2 to 25 percent. Brazil now saves thousands of dollars on shipping fees, and Mexico and Venezuela feel they enjoy new leverage over the continental giant.

Banking on its position as the country with the continent's longest border, the most neighbors and, in contrast to virtually every other South American nation, no territorial disputes, Brazil has drawn its neighbors into treaties of cooperation favoring Brazilian interests.

"One of these days the U.S. is going to wake up and realize Brazil has rearranged the continent" to Brazil's liking, a high U.S. official here commented.