President Barack Obama made a surprise visit to Central Park Saturday during his trip to the city.

The president was spotted taking a stroll through the iconic park with his two daughters. He waved to the excited crowds and even shook hands with a food cart vendor.

They stopped for a bite to eat at Upland in Gramercy Park, giving diners a rare experience to eat near the commander-in-chief.

"I think it's a great surprise," said one patron. "He was very nice, but otherwise, he wasn't very disruptive to the meal. So I thought it was great to see people like this in New York. It's why the city's so great."

"It was shocking," said another. "He was amazing. He was so casual. And the girls were, his daughters are beautiful, Sasha and Malia."

Before taking off for Washington, the Obamas went to Broadway for a matinee of the new hip-hop musical "Hamilton."

For this trip, Obama broke away from presidential tradition by not staying at the famed Waldorf Astoria, which was purchased last year by a Chinese company.

It's believed that the switch came in response to concerns that the Chinese could install surveillance in that hotel.

Instead, the president stayed at the Midtown East Hilton Hotel.

Friday night, the president and family had dinner in Greenwich Village and took a tour of the Whitney Museum. He even squeezed in some politics, attending a Democratic fundraiser in Manhattan.

The president heads back to Washington Saturday night, but he won't be home for very long. He is set to return to the city on Tuesday to make his final appearance on The Daily Show with Jon Stewart.

Obama last appeared on the show in 2012 while he was running for re-election.

Stewart is in his final three weeks as host. He announced earlier this year that he will be leaving The Daily Show after 16 years. He is being replaced by Trevor Noah in September.

Stewart's final broadcast will be on August 6.