Police stepped up patrols near the Boston Marathon finish line after a masked man walked in the street with a rice cooker in his backpack only hours after the city marked the anniversary of last year’s deadly bombing.

The arrest of a man whose mother said he had a mental disorder rattled nerves as Boston prepared for the annual race, but authorities said Wednesday that they did not consider it a security breach.

They also expressed confidence in heightened security measures for Monday’s event while acknowledging the challenge of protecting an estimated 1 million spectators and 36,000 runners across 26.2 miles and eight Massachusetts communities.

Security plans include thousands of uniformed police, hundreds of plainclothes officers and about 100 strategically positioned video cameras that will monitor the crowds. Police also strongly discouraged spectators from bringing backpacks.

“I believe this will be the safest place on the planet on April 21,” said Dave McGillivray, the long-time race director for the Boston Athletic Association.

Boston police detonated the suspicious backpack Tuesday night, along with a second backpack that was later found to have been left behind by a journalist covering the day’s remembrances, Police Commissioner William Evans said.

Neither bag contained explosives.

The 25-year-old suspect, Kevin “Kayvon” Edson, was arraigned Wednesday on several charges including threatening battery and possession of a hoax device. Bail was set at $100,000 and a judge ordered that Edson be evaluated at a state psychiatric hospital.

Evans said that Boylston Street, where the finish line is located and where twin bombs killed three people and injured more than 260 others last year, was not in lockdown when Edson walked down the street barefoot in the pouring rain, wearing a black veil and robot mask.

“That individual, like anyone, had the right to basically walk up the street,” Evans said. But because he was acting suspiciously, however, police quickly intervened, he said.

According to a police report read aloud in court Wednesday, Edson told an officer: “I knew what I was doing, it was conceived in my head. It’s symbolism, come on. The performance got the best of me.”

Joie Edson said her son had battled bipolar disorder for many years and that his mental state had recently deteriorated. His lawyer, public defender Shannon Lopez, said he was diagnosed with mental illness at 19 and that a doctor said Edson showed signs of being off his medication recently.

The finish line will not be closed to the public until the morning of the race, Evans said, but police planned to increase visibility in the area over the next several days.

Evans said undercover officers with special training will be working the crowds looking for suspicious packages or anyone “who might be up to no good.” But he added that police do not want to create undue anxiety, either.

“We are not going to scare people and make it look like it’s an armed camp,” he said.

The bombs at last year’s marathon were made from pressure cookers hidden in backpacks, authorities said. Lawyers for the surviving bombing suspect, Dzhokhar Tsarnaev, were in federal court on Wednesday arguing that the government should not be allowed to monitor prison visits from the defendant’s two sisters.