President Obama got to play soccer with a Japanese robot on Thursday, an experience he described as both “amazing” and “a little scary.”

The president visited the National Museum of Emerging Science and Innovation in Tokyo for an event designed to highlight technological collaboration between the U.S. and Japan.

Obama met with students who showed off their scientific experiments, viewed a recorded message from Japanese and American astronauts aboard the International Space Station, and announced a new initiative to increase student exchanges between the two countries.

But the highlight of the trip appeared to be the president’s interaction with a humanoid robot.

The machine, which was about the size of a 10-year-old child dressed in an astronaut suit, performed a number of life-like actions for the president, including hopping on one foot and jumping in the air.

"I can kick a soccer ball, too," the robot told the president.

“OK, come on,” Obama replied, prompting the robot to retreat a few steps and then punt the ball toward the president. Obama trapped the ball with his foot.

Later, Obama said the exhibits “showed the incredible breakthroughs in technology and science that are happening every single day.”

“Although I have to say the robots were a little scary,” he said. “They were too lifelike. They were amazing.”

Following his trip to the science center, the president visited the Meiji Shrine, a famous tribute to the spirit of Emperor Meiji and his wife, Empress Shōken, completed in the early 20th century. The original shrine was destroyed during the World War II air raids, and the latest iteration was completed in 1958.

While there, the president was treated to a demonstration of horseback archery. Archers dressed in feudal kimonos rode their horses hands free and fired arrows at two targets several feet off the ground.

The president also took part in the custom of writing a prayer on a wooden tablet to hang on a large camphor tree in the courtyard. But shortly after hanging his prayer card with the others, a priest removed the president’s, likely to prevent it from being stolen later.

In the evening, the president traveled to the Imperial Palace for a state dinner of lamb, fish and ice cream shaped in the image of Mt. Fuji. In his toast, Obama said the trip had strengthened the ties between the two nations.

"After all, though separated by a vast ocean, our peoples come together every day and in every realm,” Obama said.

"We stand together in moments of joy — as when Japanese baseball players help propel America's teams to victory. And we stand together in moments of pain as we did three years ago."