LOS ANGELES (AP) — The people became the paparazzi Friday, aiming their lenses not at the latest starlet, but toward the sky to catch a glimpse of an aging superstar headed for retirement.

It was the space shuttle Endeavour, zigzagging around California where it was born and where it will spend its golden years as a museum showpiece.

From the state Capitol to the Golden Gate Bridge to the Hollywood sign, massive crowds of spectators pointed their cellphones and cameras skyward as the shuttle, riding piggyback atop a 747 jumbo jet, buzzed past.

"It made the hair on the back of my neck stand up. It was historic, momentous," said Daniel Pifko, who rode his motorcycle to a hilly peninsula north of San Francisco to snap a few pictures of the iconic bridge.

Across California, throngs swarmed rooftops for one last peek of Endeavour airborne. Parents pulled their kids out of school. Some became misty-eyed, while others chanted "USA! USA!" as the shuttle soared overhead.

Gina Oberholt screamed for joy when she spotted Endeavour from a scenic overlook in Los Angeles. She felt a bit nostalgic because her uncle had worked as a shuttle technician.

"I've always had a special place in my heart for the shuttle program," she said.

Known as the baby shuttle, Endeavour replaced Challenger, which exploded during liftoff in 1986. Endeavour rolled off the assembly line in the Mojave Desert in 1991 and a year later, rocketed to space. It left Earth 25 times, logging 123 million miles.

Friday's high-flying tour was a homecoming of sorts.

After a nearly five-hour loop that took Endeavour over some of the state's most treasured landmarks, it turned for its final approach, coasting down the runway on the south side of the Los Angeles International Airport, where elected officials and VIPs gathered for an arrival ceremony.

As the jumbo jet taxied to the hangar, an American flag popped out of the jet's hatch. Endeavour will stay at the airport for several weeks as crew prepare it for its final mission: a 12-mile trek through city streets to the California Science Center, its new permanent home, where it will go on display Oct. 30.

NASA retired the shuttle fleet last year to focus on destinations beyond low-Earth orbit. Before Endeavour was grounded for good, Californians were treated to an aerial farewell.

Endeavour took off from Edwards Air Force Base in the Mojave desert Friday after an emotional cross-country ferry flight that made a special flyover of Tucson, Ariz., to honor its last commander, Mark Kelly, and his wife, former Arizona Rep. Gabrielle Giffords.

It circled the high desert that gave birth to the shuttle fleet before veering to Northern California. After looping twice around the state Capitol, it swung over to the San Francisco Bay area and Silicon Valley and then headed down the coast, entering the Los Angeles air space over the Santa Monica Pier. En route to LAX, it passed over a slew of tourist sites: Griffith Observatory, Dodger Stadium, Disneyland, the Queen Mary and USS Iowa in Long Beach harbor.

"Even though it was a few seconds, it was a unique experience to witness history," said Andrew Lerner, who gathered at the Santa Monica pier with his parents.

Derek Reynolds, a patent attorney from a Sacramento suburb, flew to Florida last year and camped out overnight on a bridge in the rain so he could view the last shuttle launch.

The flyover in Sacramento was a rare opportunity to share a firsthand experience of the space program with his 5-year-old son, Jack, who he pulled out of kindergarten for the day.

"I want him to experience it and give him the memory since it's the last one," Reynolds said.

Peggy Burke was among the hordes of camera-toting tourists who jammed the waterfront along the San Francisco Bay, reflecting on the end of an era.

"It's just a shame that the program has to end, but I'm so glad they came to the Bay area especially over the Golden Gate Bridge," she said. "Onward to Mars."

Along the flyover route, the mood was festive. At the Griffith Observatory, overlooking the Hollywood sign, a group of middle school children on a field trip broke out in song, giggling and belting out "The Star-Spangled Banner."

At the Hollywood & Highland Center, a shopping complex with a view of the sign, revelers yelled and screamed.

"It was like being in Times Square for the millennium," said Blue Fier, a college photography professor. "This is right up there. It was pretty cool."

The cost for shipping and handling Endeavour was estimated at $28 million, to be paid for by the science center. NASA officials have said there was no extra charge to fly over Tucson because it was on the way.

Endeavor's carefully choreographed victory lap was by far the most elaborate of the surviving shuttle fleet. Discovery is home at the Smithsonian Institution's hangar in Virginia after flying over the White House and National Mall. Atlantis will remain in Florida, where it will be towed a short distance to the Kennedy Space Center's visitor center in the fall.

Public safety officials braced for congestion, worried that motorists would "gawk and drive" as Endeavour flew over.

Traffic came to a near stop along a freeway near the NASA Jet Propulsion Laboratory east of Los Angeles when looky-loos pulled onto the shoulders and center median. California Highway Patrol officers came through and blared over loud speakers for people to move on.

As Endeavour approached LAX, other airplanes were forced to circle and wait. Passengers on an American Airlines flight from Miami snapped pictures and shot video out their windows as the shuttle arrived.

"This was a once-in-a-lifetime event," said pilot Doug Causey, who has been flying for 29 years. "That was a real treat to see something like that."

Copyright 2015 Associated Press. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed.

Online Public Information File

Viewers with disabilities can get assistance accessing this station's FCC Public Inspection File by contacting the station with the information listed below. Questions or concerns relating to the accessibility of the FCC's online public file system should be directed to the FCC at 888-225-5322, 888-835-5322 (TTY), or fccinfo@fcc.gov.