A man has been taken into custody for possessing a hoax device after being found with a rice cooker in his backpack following a first anniversary tribute near the Boston Marathon finish line, Boston police say.

Police Superintendent Randall Halstead said the man was stopped on Tuesday night by an officer who saw him acting suspiciously. He said the man dropped the backpack.

The incident occurred close to where three people died and more than 260 others were injured a year ago when two bombs exploded near the marathon's finish line, on April 15, 2013.

Those bombs were made from pressure cookers packed with explosives, nails and other shrapnel that were concealed in backpacks.

Halstead said the man involved in Tuesday's hoax also faced charges of disturbing the peace and disorderly conduct.

The backpack was blown up by the bomb squad as a precaution, as was a second unattended backpack found nearby.

Halstead would not say what was in the second backpack or who owned it, but said police were investigating.

The incident rattled nerves during anniversary tributes commemorating the victims of the Boston Marathon bombings, which were attended by about 2,500 people.

Authorities allege two brothers were behind last year's bombings. Tamerlan Tsarnaev, 26, died following a shootout with police several days after the bombings.

Dzhokhar Tsarnaev, 20, has pleaded not guilty to 30 federal charges and is awaiting a trial in which he faces a possible death sentence.

Authorities allege the brothers also killed police officer Sean Collier several days after the bombings in an attempt to steal his gun.