BOGOTA -  Colombia's Congress has passed a tax reform bill in a victory for President Juan Manuel Santos, who is fighting the threat of a credit downgrade amid a slump in oil revenues.

The win in Congress comes at a delicate time for Santos, who is seeking to implement a controversial and costly peace deal with the FARC rebel group just as the Colombian economy is feeling the pain of the global plunge in prices for its top export.

The core of the tax reform is an increase in the sales tax rate from 16 to 19 percent, an unpopular measure that Santos insists is the best way to shore up the government's increasingly shaky accounts. The Senate passed the measure in the early hours of Friday, a day after it cleared the lower house.

Differences between the two versions of the bill must still be worked out in committee before it goes to Santos to be signed. The administration praised lawmakers for getting on board.

"These decisions aren't easy. They are unpopular on the first reading. But behind that is the greater interest of the nation," said Finance Minister Mauricio Cardenas. Opponents disagreed, saying the sales tax increase will hit poor and working-class Colombians hardest -- even as large companies get a tax cut, which Santos says is needed to spur investment and job creation.

"This is a regressive (tax). It is abusive toward Colombians with lower income," said center-left lawmaker Claudia Lopez. The collapse in Colombia's oil exports -- which totaled nearly $26 billion in 2014, nearly half its total exports -- have left the government facing the specter of a credit rating downgrade.

That would add to Santos's headaches at a time when he has already expended much political capital pushing through the peace deal aimed at ending five decades of conflict with the Revolutionary Armed Forces of Colombia (FARC).

Santos won this year's Nobel Peace Prize for shepherding the peace deal to conclusion. But opponents say it grants the FARC impunity for war crimes. Voters rejected the initial version of the deal in a referendum, leading Santos to pass a slightly revised version through Congress instead.

It includes provisions on rural investment and reforms that will be costly to implement, adding to the urgency of shoring up the government's finances.