It was a night of joy throughout Italy as the nation celebrated its 3-1 victory over West Germany in the World Cup final yesterday in Madrid.

The caribinieri--paramilitary police--estimated that more than 300,000 joined in the madness in Rome. They sang, chanted and waved banners as they made their way through the city's historic center, following the traditional route of victorious generals in ancient times.

Not even the unseasonably cool weather kept people out of the city's famous fountains. Hundreds shouted and splashed in Trevi Fountain, whose famed marble seahorses were draped with national flags. Police had closed the city's squares to traffic two hours before the match, but were restrained in dealing with the rambunctious crowd.

"It's going to be a long night for us, too," said one officer. No serious incidents were reported as of early morning, although 40 people were hospitalized for minor injuries and there had been minor incidents of vandalism.

By early morning, authorities said they had given up counting the number of overloaded cars involved in minor accidents.

At Piazza del Popolo, where hundreds watched the game on a giant screen erected by the state-owned television network RAI, the whistle signaling the end of the game was greeted with a loud, prolonged roar.

The city's largest square quickly filled with smoke from fireworks and thousands of persons blowing whistles and beating drums.

They flashed signs saying "Germany Rest in Peace" and "Italy You Are Great."

One placard put it more succinctly: "Knockout."

Ships in the Bay of Naples blew fog horns and sirens while thousands of cars and people on foot inched through the streets of the southern town, the Italian news agency ANSA reported.

Reuter said residents of densely populated slum quarters hauled down the week's washing that normally festoons the narrow streets and ran up thousands of green, white and red Italian flags. Hastily printed notices with black borders appeared everywhere in shop windows proclaiming, "The death of German soccer in Madrid on July 11, 1982."

A senior Western diplomat who passed through Naples before the match commented, "A win will almost certainly give more political stability to Italy. Every nation needs to have something go right, and soccer is, of course, very important to Italians, not just as a game."

In central Bologna, exuberant citizens covered themselves in Italy's tricolors as they splashed in the city's fountains.

City streets and highways across the country were packed with cars, police reported.

Premier Giovanni Spadolini called it a "grand victory for Italy."

"This is a unifying element for Italians," a joyful Spadolini told reporters in Milan, where he watched the game. "This great event, beyond its sports characteristics, will help bring Italians closer to one another."

In West Germany, reaction was mixed, with the predominately Italian sections of the big cities celebrating wildly. Dortmund police sealed off the Italian quarter of that city to give free rein to the jubilation.

"It was dream soccer," said an Italian in Munich, where hundreds watched a live broadcast in the main square, Marienplatz. "All 11 players were great."

West Germans took their defeat with resignation, most agreeing that the better team won.

"The Germans played well, the Italians were better," said a Munich resident. "The German team was lucky even to get to the final," said a man from Cologne.

Only a few minutes after the final whistle Italians blocked traffic in West Berlin's main street, singing, dancing and hugging each other.

But all was quiet in cities with little Italian population. Bar and cafe owners who had laid in extra supplies of beer for celebrating Germans were disappointed.

Fans in the United States, which for the first time was able to see the World Cup final live on network television, also celebrated. In New York City, minutes after the match ended, scores of people blocked traffic and carried Italy's flag through the streets of the predominantly Italian Brooklyn neighborhood of Bensonhurst.

Champagne corks popped and firecrackers exploded as the crowd marched and cheered. Traffic came to a virtual halt, with many Italians riding on tops of cars and on flat-bed trucks.

In the Italian North End of Boston, there were chants of "Italia, Italia" and more waving of flags as people paraded through the crowded streets. Champagne bottles were popped, firecrackers exploded and a hose was run from a coffee house out onto Hanover Street to douse the happy celebrants.

This was Italy's first World Cup championship in 44 years. "We've been waiting for this for years," said Fausto Seandone, who was born in Italy 29 years ago and has lived in Boston the last 18.

In the Little Italy section of Baltimore, a group of about 50 fans paraded through the streets carrying Italian flags and signs saying "Italia Numero Uno."

Toronto's Little Italy, whose 500,000 population makes it the largest Italian community outside of Rome, was filled with celebrants. The streets were human ribbons of the Italian national colors by the time the game ended. One man painted his hair in the tricolors and a woman did the same to her baby's diapers.

A three-mile strip of street was closed to traffic. People shouted themselves hoarse chanting "Italia" and "Rossi."

"We won! We won! We're the best in the world!" one man screamed as he careened through the street, grabbing everyone in sight and planting a kiss on each cheek.

Some of the North Americans in Spain weren't so happy. A number of those who had purchased World Cup package tours--some spending more than $4,000 for air fare, hotel and seats--found themselves standing for the game.

Those who bought tickets from scalpers in some cases fared better; the scalpers found themselves overloaded with tickets and, in some cases, dropped prices almost to face value by game time. Peter Wallrath of Hamburg and a friend bought front-row tickets for $10 apiece--$2 over face value.