BOSTON — A man who authorities say was taken into custody near the Boston Marathon finish line carrying a backpack containing a rice cooker on the anniversary of the deadly pressure cooker bombings is scheduled to appear in court on Wednesday.

The 25-year-old man is expected to be arraigned in Boston Municipal Court, according to the district attorney’s office. Authorities have not publicly identified him.

He faces a charge of possession of a hoax device, but authorities say more charges may be added.

The man was stopped late Tuesday by an officer who saw him acting suspiciously, including walking barefoot down the middle of a street, veiled in black, in pouring rain, police Superintendent Randall Halstead said. The man dropped the backpack and told the officer it contained a rice cooker, he said.

The backpack was destroyed.

The incident took place hours after ceremonies to mark last year’s Boston Marathon bombings, in which two pressure cooker bombs hidden in backpacks exploded, killing three people near the finish line and injuring more than 260 others.

A second suspicious backpack was determined to have been left behind by a media outlet and was not a danger.

The backpacks rattled nerves days ahead of this year’s marathon. Police kept people away from the finish line area for about three hours Tuesday and trains bypassed the nearby Copley Square station.

“With the marathon coming, our officers are taking it seriously,” Halstead said. “The safety of the public is utmost.”

Survivors, first responders and relatives of those killed last year marked the day with tributes. Former Mayor Thomas Menino and Vice-President Joe Biden were among those who spoke at the nearby Hynes Convention Center. A moment of silence was held at the finish line in the afternoon.