TORONTO -- It's understandable Ontario teachers are angry at having a contract imposed on them, but the province cannot afford to give out raises while fighting a $15-billion deficit, Premier Dalton McGuinty said Tuesday as he visited a Francophone school in Toronto on the first day of classes.

The legislation imposes a two-year wage freeze on veteran teachers while allowing younger ones to still move up the salary grid, mandates three unpaid days off in the second year, and limits their ability to bank sick days and cash them out at retirement.

It is based on agreements the Liberal government reached with the English Catholic teachers that was also accepted by Francophone teachers, but was rejected by the two biggest unions representing elementary and high school teachers.

"I understand where teachers are coming from," McGuinty told reporters after touring Pierre Elliot Trudeau elementary school.

"They've made plans to manage their own home finances and then this guy McGuinty comes along and says 'we've got to hit the pause button for a couple of years."'

Teachers received raises averaging 25 per cent since 2003 and should realize the Liberals are the party that truly believes in public education, added McGuinty.

"I'm proud of our teachers and I know we've hit a bit of a rough patch, and that's not unusual when it comes to periods of economic constraint," he said.

"The only thing that has changed -- we're the same government, we're the same people and the same leader absolutely devoted to publicly funded education -- is that we've been hit by a terrible recession and we've got to eliminate the deficit."

The premier wants voters to forget the "huge raises" he gave teachers and other public sector unions over the past nine years so he can now claim he is serious about cutting government spending, said Progressive Conservative Leader Tim Hudak.

"He's talking out of both sides of his mouth, clearly, and I think people will see through it," said Hudak.

The opposition parties said McGuinty tried to create a crisis in education with an emergency recall of the legislature in August to impose a contract on teachers -- legislation that won't be passed before Sept. 10 -- in order to help the Liberals win two byelections this week, which would give them a majority government.

"This emergency session has been a charade," said Hudak, "a transparent phoney effort to distract attention away from the real record during these byelections."

The New Democrats said the first day of school went off without a hitch, just as teachers had said that it would, and took a shot at the Conservatives for promising to help the minority Liberal government pass the legislation to impose a contract on teachers.

"Dalton McGuinty's manufactured crisis to get a majority was nowhere to be seen," said NDP Leader Andrea Horwath as she campaigned in Kitchener-Waterloo Tuesday.

"I'm disappointed that the premier expects people to fall for this, and I'm disappointed in Tim Hudak who is helping Dalton McGuinty waste hundreds of millions of dollars."

The NDP fear the legislation will be overturned by the courts and cost the province even more in the long run, but the Liberals are confident they've made serious enough efforts to negotiate with the teachers' unions that the courts will uphold the legislation.

The Tories want the government to immediately legislate a two-year wage freeze for all 1.3 million public sector workers, including doctors, nurses and civil servants, something the Liberals say would indeed be overturned by the courts.

The cash-strapped province just doesn't have money for raises, said McGuinty, who predicted the government's fight with teachers would soon be over.

"I think most teachers understand we've got to make a choice and we can either put more money into pay hikes or we can put more money into expanding full day kindergarten and keeping class sizes small, which by the way hangs on to teachers jobs," he said.

"My sense is that sooner rather than later, this will be behind us. We will have hit the pause button on teachers' pay for a couple of years and we will move forward with something else that freezes pay for the broader public sector as well."

The Liberals are widely expected to hold on to the Vaughan riding Thursday, but the other byelection in Kitchener-Waterloo, which had been Tory for two decades, is shaping up to be a very close three-way battle that will decide whether or not Ontario has a majority or a minority government.