It must now be approved by the country's parliament.
The new bill limits Japanese vessels to refueling and supplying water to ships on anti-terrorism patrols, but not to those involved in military operations.
The current mission expires on November 1. The opposition, led by Japan's Democratic Party, which controls the upper house of parliament, is opposed to its extension, saying that it was not duly authorized by the UN.
Prime Minister Yasuo Fukuda's government amended the bill in a bid to placate its opponents, saying that terminating the mission would sideline Japan in the war on global terrorism.
At present, 17 vessels from eight countries (the U.S., U.K., France, Germany, Pakistan, Canada, New Zealand and Japan) are involved in Maritime Intercept Operations, or MIO, in the Indian Ocean and the Persian Gulf as part of the U.S.-led Operation Enduring Freedom.