In November the prime minister, who is a staunch supporter of the naval support mission, had to order Japanese ships back to port after a resurgent opposition blocked efforts to renew the deployment.
The pullout was an embarrassment for Yasuo Fukuda, casting doubt on how far Japan could support the US-led "war on terror".
Friday's vote marks the first time in more than 50 years that the Japanese government has used its majority to override legislation.
Akio Sato, a ruling party MP, told parliament before the vote that "it is of great detriment to Japan that this mission, which addresses international needs and is in our national interest, has been suspended".
"Japan must join the world in the fight against terrorism," he said.
The main opposition Democratic party, which took control of the upper chamber in elections last year, opposes the mission because it says it violates Japan's pacifist constitution and military operations in Afghanistan do not have explicit UN support.
The Democrats submitted an alternative bill that would focus more on humanitarian aid within Afghanistan, rather than support for military missions.
Democratic legislator Hiroe Makiyama said Japan needed to "send shovels not guns, and water not fuel".
Fukuda has earlier tried to reach a compromise with the Democrats, even raising a power-sharing proposal between the two parties.
But the opposition refused to co-operate, triggering parliamentary gridlock and forcing Fukuda to use the ruling coalition's lower house majority to ram the bill through parliament.
The move is exceedingly rare in Japan, where the government strives to maintain the appearance of consensus rule.
The last time the lower house overruled a rejection by the upper house was in 1951.
Fukuda's ruling party also extended the parliamentary session by a month to mid-January to ensure the bill's approval.
Although the bill has now been approved - sending Japanese naval ships back to the Indian Ocean as early as next month - the mission will be significantly scaled down.
It will be limited to refuelling and supplying water to ships used in monitoring and inspecting vessels suspected of links to terrorism or arms smuggling.
Warships directly involved in military operations inside Afghanistan will not be refuelled.
Japan had in the past six years provided logistical support to forces involved in the war in Afghanistan, mainly supplying fuel to warships.