After being confined nearly two days in a downtown hotel by court order, bargainers emerged yesterday with a tentative agreement that could end the bitter 77-day-old strike by public school teachers.

Eugene Kolach, president of the Cleveland Teachers Union, said he was recommending that teachers accept the offer.

On Tuesday night, Kolach had urged the 5,200 teachers to ignore a judge's order to return to work at 8 a.m. yesterday, and pickets were gathering when the judge announced the settlement at 7:30 a.m.

Cuyahoga County Common Pleas Judge Frederick M. Coleman said he hoped that teachers would be back at work Friday. He suspended the back-to-work order.

School officials also dropped plans to reopen classes for the city's 92,000 students today. The teachers are scheduled to vote on ratification this afternoon.

Meanwhile, Chicago officials and bankers late yesterday reached a tentative agreement on a plan to keep the nation's third largest school system from going bankrupt and closing, possibly by the weekend. However, it was reported unlikely that enough money could be raised to meet Friday's payroll. Teachers have threatened to walk out if they miss their second paycheck in two weeks.

The complicated bailout plan involves the city's largest banks lending the city money to buy securities from the board of education.