TOKYO  Japan’s defense minister ordered the nation’s naval ships to return from the Indian Ocean on Friday, fulfilling a pledge by his government to end an eight-year refueling mission in support of the war in Afghanistan.

A destroyer and a supply ship that had been refueling American and other warships are to head home at midnight, when a special law authorizing the mission expires. Prime Minister Yukio Hatoyama refused to renew the law, ignoring requests from the Obama administration to continue the mission as a show of diplomatic support for Washington.

The Japanese withdrawal had been expected for months, and military experts have said it will not affect military operations in Afghanistan. But it is symbolic of Mr. Hatoyama’s efforts to reduce his country’s dependence on the United States, and assert more independence on diplomatic issues.

Members of Mr. Hatoyama’s left-leaning coalition have criticized the operation for violating the nation’s pacifist Constitution and for aligning their nation too closely with Bush administration wars that many Japanese saw as unilateral. Ending the mission was a campaign pledge of Mr. Hatoyama’s Democratic Party, which swept aside a half-century of Liberal Democratic rule last summer.