The box cars were moving at about four miles an hour when they went off the tracks, officials said. (CBC)

Two box cars loaded with bales of pulp derailed in west Saint John on Monday morning, but no one was hurt and traffic was not affected, according to a NB Southern Railway official.

The two cars remained upright and were put back on the rail by 9:30 a.m., Geoff Britt, spokesperson for the Irving-owned company, said in an email to CBC News.

"This time of year the ground is soft, and one of the box car wheels rode up and dropped off the rail," he said.

The section of track, located at the rail yard near Moosehead Breweries, which is used for staging and switching cars, is now being repaired, said Britt.

The cars were moving at about four miles an hour at the time of the incident, he said.

Rail service was not disrupted.

Last May, three NB Southern Railway tank cars containing spin acid, molten sulphur and crude oil left the tracks near Shur-Fit Automotive on Rothesay Avenue.

The cars also remained upright and undamaged in that case, officials said.