They concluded a three-day meeting ahead of their leaders' summit on July 7-9 in Toyako, a lakeside resort on the northern Japanese island of Hokkaido.
"To fight terrorism or other organised crimes, not only the G8 and developed countries but all countries must have sufficient coping capability," Japanese Justice Minister Kunio Hatoyama told a joint news conference.
"If some countries are weak in legal systems or investigation capability, their loopholes would be taken advantage of," Hatoyama said.
Japan's police chief Shinya Izumi told the conference: "Needless to say, we must keep paying special attention to the threat of international terrorist organisations, such as Al-Qaeda."
The eight countries said in a statement that they were committed to "providing assistance within the scope of our authority" to developing nations.
A joint statement by the eight nations