Colombia’s finance minister resigned on Monday after the government was forced to withdraw a highly unpopular tax reform bill that had sparked six days of street protests in which 17 people died.

Alberto Carrasquilla said he was stepping down to allow the government to reach the consensus necessary to push a tax reform package through congress. President Iván Duque said Carrasquilla would be replaced by the commerce minister, José Manuel Restrepo Abondano.

The government presented the tax reform bill, which the former finance minister had designed, to Colombia’s congress last month. It aimed to raise 1.4 per cent of gross domestic product, or $4.1bn, by eliminating some exemptions and broadening the tax base, among other measures.

But within days, even parties that were expected to support the tax code changes rejected them. Duque’s rightwing Democratic Centre party urged the president and his finance minister to tweak the bill.

Last Wednesday, thousands of people took to the streets in protest. The size of the demonstrations appeared to take the Colombian government by surprise and emboldened organisers, who extended them for several days. The protests have turned increasingly violent and the government has deployed the army in some cities to restore control.

The state ombudsman’s office said on Monday that 17 people, including one police officer, had been killed in the clashes and 846 others injured, including 306 civilians. The defence minister claimed the violence was “premeditated, organised and financed” by leftwing guerrilla groups.

Duque said on Sunday his government would present an alternative tax bill to congress, and hinted at some of the measures it might contain.

Those included temporary measures such as a corporate tax surcharge and increases to Colombia’s wealth and dividends taxes as well as additional expenditure cuts. A plan to increase the value added tax on goods and services will be scrapped.

“The fact that the new bill would now be transitory in nature . . . means that the country’s signalling of its commitment to adjustment is now weaker,” Citibank analysts wrote. “This will weigh negatively on rating agency decisions.”

The tax reform is the most important piece of legislation in Colombia this year. The country’s investment-grade status depends on it.

Both Fitch and Standard & Poor’s have rated Colombia triple B minus with a negative outlook for the issuance of long-term debt. That is just one notch above non-investment or junk status. Moody’s has rated Colombia Baa2, two notches above junk.

If the tax reform effort fails or is diluted, there is a strong chance Colombia will be demoted out of a small group of Latin American investment-grade nations that includes Mexico, Chile and Peru.

That would be a blow to a country that, despite its long civil conflict and well-chronicled lawlessness, has prided itself on fiscal rectitude. In sharp contrast to most nations in the region, Colombia has not defaulted on its debt since the 1930s and has enjoyed investment-grade status since 2011.

While the withdrawal of the tax bill and Carrasquilla’s resignation could ease tensions, protesters have vowed to return to the streets on Wednesday.