A man has been questioned by police for possessing a vessel containing what appeared to be homemade gunpowder near the U.S. Embassy in Tokyo earlier this week, investigative sources said Wednesday.

The man in his 20s was quoted as telling police, "I learned how to make gunpowder on the internet and came to throw it into the embassy," prompting police to investigate him on suspicion of violating the explosives control law, the sources said.

The man, who identified himself as a university student, was stopped by a police officer on the street in front of the embassy in central Tokyo at around 9 p.m. Monday after he was observed acting suspiciously.

He was found to be carrying in his pocket a cloth-wrapped cup containing a granular substance, the sources said, but it is unclear whether he had any intention or system to ignite it.

A quick analysis found that the substance could be gunpowder, the sources said.

The police searched the man's house in Osaka Prefecture on Tuesday and seized what are believed to be ingredients needed to make gunpowder. The police are investigating his motives and suspect he was acting alone.

The incident occurred just over a month after former Prime Minister Shinzo Abe was shot and killed by an assailant with a homemade gun. The suspect in Abe's killing told investigators he learned how to make a gun by watching YouTube videos.