Japan has released a Chinese fishing boat captain whose arrest two weeks ago led to a major row with Beijing.
Japan had accused Zhan Qixiong of deliberately ramming two patrol vessels near disputed islands in the East China Sea.
China said his detention was "illegal and invalid", and cut off ministerial-level contacts with Japan.
The release came after four Japanese were detained in China on suspicion of illegally filming in a military area.
A Japanese foreign ministry spokesman said its embassy in Beijing had received confirmation that the four were being held, but he said he did not want to speculate whether it was linked to Japan's detention of a Chinese fishing boat captain.
Officials said the four men were employees of a Japanese construction company who were in China to bid for a project to dispose of chemical weapons from World War II.
At a news conference, prosecutors in Naha, Okinawa, said Mr Zhan was just a fishing boat captain and had no criminal record in Japan.
They said they did not perceive any premeditated intent to damage the patrol boats and therefore had decided that further investigation while keeping the captain in custody would not be appropriate, considering the impact on relations with China.
"It is a fact that there was the possibility that Japan-China relations might worsen or that there were signs of that happening," said Chief Cabinet Secretary Yoshito Sengoku, the Reuters news agency reported. "Our ties are important and both sides must work to enhance our strategic and mutual beneficial relations."
Spokeswoman Jiang Yu said on the Chinese foreign ministry website that the government was sending a charter plane to bring Mr Zhan home, reiterating that "any form of so-called legal procedures taken by Japan against the Chinese boat captain are illegal and invalid".
Tensions had escalated since Japan detained the Chinese captain.
Beijing cut off ministerial-level contacts between the two countries and thousands of Chinese tourists pulled out of trips to Japan. Concerts by a Japan's top boy band SMAP due to take place in Shanghai were cancelled by the Chinese organisers.
Earlier this week Chinese Premier Wen Jiabao said that Japan bore full responsibility for the situation and demanded the immediate release of the captain.
On Thursday, US Secretary of State Hillary Clinton urged the two sides to settle the issue before it had a long-term impact on the region.
The Japanese coastguard arrested Zhan Qixiong on 8 September after his trawler collided with two of their patrol boats in an area claimed by both countries, near uninhabited islands which may have oil and gas deposits
Japanese prosecutors had until next Wednesday to decide whether or not to charge the man.