NEW YORK -- Robert F. Wagner, 80, who was mayor of New York City from 1954 to 1965 and later U.S. ambassador to Spain and envoy to the Vatican, died Feb. 13 at his home here. The cause of death was not reported.

A lifelong Democrat, Mr. Wagner was a state assemblyman and Manhattan borough president before becoming mayor and then turning to diplomacy. But he never realized his greatest political ambition, to serve in the United States Senate as his father, Robert F. Wagner Sr., had done for 23 years.

Robert F. Wagner Jr. ran for the Senate once, in 1956, losing to Republican Jacob K. Javits in the second Eisenhower landslide.

Mr. Wagner's three terms as mayor was a longevity record matched only by Fiorello LaGuardia and Edward Koch. He said he liked being mayor despite the headaches that went with it, including race riots, waterfront and newspaper strikes, police scandals, school boycotts by blacks and a water shortage.

He was criticized frequently for procrastinating, often forming study committees so that a problem might have time to fade away, rather than taking action.

Mr. Wagner was mayor when the Brooklyn Dodgers moved to Los Angeles and the Giants baseball team moved to San Francisco. But he had Shea Stadium built and was on hand when the New York Mets first played baseball there in 1962.

He also helped save Carnegie Hall and kept the subway fare at 15 cents during his 12 years in City Hall.

With then-Gov. Nelson A. Rockefeller, he was instrumental in establishing Lincoln Center for the Performing Arts and battled to allow free Shakespeare performances in Central Park.

After leaving office at the end of 1965, Mr. Wagner served as ambassador to Spain in 1968 under President Johnson, and he was President Carter's envoy to the Vatican from 1978 to 1980.

He made another bid for City Hall in 1969, but finished second in the Democratic primary. The primary winner, Mario A. Procaccino, lost the general election to incumbent Republican John V. Lindsay.

Born in New York City, Mr. Wagner attended Yale University and its law school, the Harvard School of Business Administration, and the School of International Relations at Geneva.

He served in the Army Air Forces in World War II, finishing the war as a lieutenant colonel with the Bronze Star and the French Croix de Guerre.

His first wife, the former Susan Edwards, died in 1964. His marriage to Barbara Joan Cavanagh was annulled.

Survivors include his wife, Phyllis Fraser Cerf, who was the widow of publisher Bennett Cerf; and two sons by his first marriage, Duncan Wagner and Robert W. Wagner III, who is the head of the New York Board of Education and a former city councilman, city planning commissioner and deputy mayor.