A gigantic Panamanian flag was hoisted today to symbolize the end of 76 years of U.S. control over the Panama Canal Zone that cuts like a knife through this Central American country.

Vice President Mondale was present at the ceremony that took place on a hilltop overlooking where the Panama Canal meets the Pacific Ocean.

The raising of the flag stop Ancon Hill, the highest point in the Canal Zone, was a signal that sent an estimated 250,000 Panamanians surging through the gates of the formerly closely guarded zone in a massive assertion of Panamanian sovereignty over the 553-square mile area.

That, in turn, touched off a day-long fiesta of speeches, military ceremonies and spontaneous street demonstrations, marking the implementation of the first phase of the treaties under which the United States will surrender control of the canal by the end of the century.

It was a day that contained a number of discordant notes such as a profusion of banners with anti-American slogans and some scattered retorts by Americans who have lived in the zone and run the canal.

Among Latin American leaders here for the occasion, there also was an undercurrent of concern about what President Carter would say tonight in his TV address on Soviet troops in Cuba and the possible implications for the peace of the hemisphere.

These leaders made clear that they were waiting anxiously to hear what was said publicly by Carter and privately by Mondale, his representative here, in meetings scheduled later tonight.

But, to the people who thronged the streets of the capital and spilled over into the zone the matter of all-consuming interest and undisguised joy was that, from today, the territory adjoining the 72-mile canal will be an integral part of Panama under Panamanian control and subject, for the most part, to Panamanian law.

Under the treaties -- signed in Washington Sept. 7, 1977, by Carter and Panama's ruling strongman, Gen. Omar Torrijos -- the United States will retain only reduced military installations for defense of the canal.

The treaties, which sparked great controversy in the United States and were approved by the Senate last year by a single-vote margin, also turn operation of the canal over to a joint U.S.-Panamanian commission.

Although the United States will have the dominant voice in the commission during the coming years, its purpose will be to turn over increasing authority to Panama and, ultimately, to turn the canal into a Panamanian-owned and operated entity by the end of the century.

That point, intended to remove a longstanding cause of friction in U.S.-Latin American relations, was hammered at repeatedly Monday by Panamanian President Aristides Royo Sanchez and an by other Latin American dignitaries in their many public appearances throughout the day.

A strange note was struck by the absence of Torrijos from the ceremonies. Since turning the presidency over to Royo a year ago, Torrijos -- who has controlled Panama for the past decade -- has gone into virtual seclusion and failed to put in an appearance at any of today's events.

The day began early when Royo, accompanied by Mondale and visiting heads of state, climbed Ancon Hill. There the Panamanians had erected a 150-foot high stainless steel flagpole to which was attached a red, white and blue Panamanian flag weighing 44 pounds and measuring 48 by 33 feet.

As a band played the national anthem, the flag uas hoisted up the pole. It was visible for miles around, even through the mists shrouding the lower part of the hill.

It was at that point that the thousands of Panamanians singing, chanting, waving flags and carrying banners began pouring into the zone. Throughout the zone, most American residents remained secluded in their homes and all business was suspended.

The biggest sign of resentment among American residents occurred at Balboa High School, where in 1962, a demonstration by U.S. students touched off anti-American rioting in Panama and began the 15 years of negotiations leading to the treaties.

Today, the statute of the discoverer of the Pacific that stands in front of the high school was splotched with yellow, green, red and black paint. Nearby were scrawled signs saying "RIP -- 1904-1979. Canal Zone. By Act of Congress," and "We mourn with bloody tears."

In general, though, U.S. and Panamanian officials said the transfer of authority appeared to be taking place without incident. Joint patrols of U.S. and Panamanian policemen were evident on zone streets. The symbols of the old Panama Canal Company, which operated the canal through most of its history, had been replaced by the Panamanian official seals.

Most of the crowds moved towards Albrook Air Force Base, where the official turnover ceremonies took place in a large, open area in front of U.S. Air Force hangars. The ground in front of and around the sides of the hangars was covered by a mass of people estimated by some U.S. and Panamanian officials at more than 100,000. For almost two hours, they stood in the heat listening to addresses by Mexico's President Jose Lopez Portillo, Mondale and Royo.

Mondale, in his speech, said that while the canal originally had been viewed as a triumph of engineering success and genius, it now would be seen also as a sign of "success in the peaceful resolution of disputes and good relations between large and small nations."

His speech uas interrupted several times by groups of Panamanian leftists chanting anti-American slogans and waving banners proclaiming "Yankees out of Panama" and "Sovereignty or death."

Nevertheless, the vice president took the jeers in stride and evoked cheers when he shouted to the crowd: "We will honor in full the terms of the treaty. We uill keep the canal operating smoothly."

He also sparked an enthusiastic response from the crowd when he spoke of "hopeful signs of emerging democracy" throughout Latin America, and promised U.S. support and cooperation for the radical Sandinista government that took power in Nicaragua this summer. Panama was a strong supporter of the Sandinista cause during the struggle to overthrow the dictatorship of former president Anastasio Somoza.

From Albrook, the dignitaries then moved to nearby Fort Amadour, another zone military outpost where a brief signing ceremony took place to mark officially the start of a joint U.S.-Panamanian defense committee to safeguard the canal in the future.