An agreement has been struck between the province and two doctors’ federations, Health Minister Gaetan Barrette announced Wednesday.

The longstanding dispute was finally solved between the government and both the Quebec Federation of General Practitioners and the Quebec Federation of Medical Specialists, as the doctors agreed to $1.2 billion in pay hikes over eight years.

Premier Philippe Couillard told a scrum of reports that it's "very, very good news." He thanked the doctors for taking Quebec's financial constraints into consideration in negotiating the deal.

They will get none of the extra cash this year, however, to help the government achieve a balanced budget by March 2016.

“I'm happy to see that doctors in Quebec see the situation we are in and have decided to be part of the solution in order to being us back to budget balance,” said Couillard.

The deal will bring Quebec doctors’ salaries closer to what other Canadian doctors earn.

The specialists will vote on the deal Thursday night; the family doctors vote on it on Oct.4.

Meantime, the opposition CAQ said the hikes don't deal with a much larger problem – inefficiency in the health care system.

“So far Mr. Barrette is not working on efficiency. He's only working on shovelling the problem in the next eight years,” said CAQ leader François Legault.

Salary hikes for doctors won't help overcrowding in Quebec hospitals, PQ health critic Diane Lamarre said.

“We pay a lot for our health care and last week we saw people in sleeping bags waiting at the ER,” she said.

Barrette said better health care access starts with public finances.

“No matter what, we have to tackle it. It will be for the patient and obviously putting back the public finances in this province is absolutely necessary,” said the health minister.

Now that the minister has dealt with doctors' salaries he said he will focus all of his attention on what he says is his top priority - helping Quebecers get better health care.