TOKYO - As mourners, some weeping, piled Japanese comics, flowers and other mementos at the scene of a deadly stabbing rampage, the government yesterday sought to impose tighter controls over large knives and provide better security in public places.

News that the attacker had posted Internet messages saying he intended to kill people in the Akihabara district, the heart of Tokyo's comic-book and youth culture, added to the shock as Japan struggled to make sense of the violence, which left seven people dead and 10 wounded.

"It's unbelievable that things like this are happening in our country," said Tsutsumo Hirano, 19, who attended high school with one of the victims, paying respects at the makeshift memorial.

Tomohiro Kato, 25, a temporary worker at a factory outside Tokyo, was splattered with blood when he was arrested Sunday during the lunchtime attack in the crowded shopping district.

Police say Kato rammed a rented two-ton truck into a crowd of shoppers, then jumped out and began stabbing victims who had been knocked down before lashing out at others in the crowd.

Yesterday, Internet sites and the media carried a series of messages posted on an electronic bulletin board in the hours before the attack.

The national broadcaster NHK said Kato posted messages under a thread titled "I will kill people in Akihabara" and wrote: "I want to crash the vehicle and, if it becomes useless, I will then use a knife. Goodbye, everyone."

Authorities confirmed that Kato had posted messages but did not release details.

The attack was a blow to Akihabara, once a low-cost electrical-supply district that has grown over the last 15 years into Tokyo's premier computer and youth-culture center, with everything from huge multistory electronics emporiums to cafes where youths read comic books and hostesses dress as popular animation characters.

In an emergency meeting, the ruling coalition considered limiting access to knives like the one used in the stabbing, which had a five-inch blade.

"Obviously, the suspect possessed the knife without a legitimate reason," Chief Cabinet Secretary Nobutaka Machimura said. "I think we have to seriously consider what we can do to step up the restrictions."

Japanese authorities grappled with possible explanations for the attack, the latest in a string of assaults in recent years. Some speculated that the growing gap between rich and poor was spurring rage among have-nots like Kato; others said Japan had become a lonelier place in recent years.

"The group mentality has given away to individuality in Japan," said Nobuo Komiya, a criminologist at Rissho University in Tokyo. "This is fine for people who can deal with their problems on their own, but not for those who need someone to talk and listen."