School Street was closed for about four hours yesterday as officials worked to get a CSX freight engine car back on the track after it derailed late Wednesday afternoon.

Officials waited until yesterday morning to fix the problem so they could work in daylight. No one was injured, and there was no damage to the environment, police said.

CSX representative Bob Sullivan would not say what the car was carrying, but he described the incident as minor.

"Had it been a serious accident, they would have cleared it Wednesday night," police Sgt. James Bruce said.

The car went off the track around 4 p.m. because of ice on the rails, Bruce said.

The front car that derailed was separated from the remaining cars so School Street wouldn't be blocked. The engine was left a bit askew but still standing upright. No materials inside the train or fuel were spilled, police said.

The train was headed west and went off the track just after it passed School Street, near the Parliament Court apartments.

Sullivan said the train comes from Framingham and delivers materials to local businesses.

Police shut School Street at Summer Street yesterday morning as workers from R.J. Corman Derailment Services of Albany, N.Y., righted the engine. The road was reopened by 1:15 p.m.

CSX plans to move its subsidiary Transflo site in Allston to Westborough by 2012 as part of its plan to increase train service in Massachusetts. The Westborough location would act as a transfer station for materials, some of which are potentially dangerous, to be put on trucks and distributed to area businesses.

Over the past few months, Westborough officials have discussed potential risks with CSX, specifically hazardous chemicals coming into the site, which is on Walkup Drive.

CSX representatives assured officials that they have established a comprehensive plan to avoid spills, including the use of double-valve containers to store chemicals that pass through.

Despite Wednesday's derailment, Westborough Police Chief Alan Gordon said he is not concerned about potential risks at the future Transflo site.

"Things like that are going to happen periodically," Gordon said. "I think CSX is very careful, and they certainly don't want any type of derailment (to happen)."