(Updates throughout with blaze now under control and details about response)
By Julie Gordon
VANCOUVER, March 4 (Reuters) - A large portion of Canada's biggest port was shut down on Wednesday after a chemical fire broke out amid numerous shipping containers piled up in a yard east of Vancouver's downtown core.
The toxic smoke forced local residents to take shelter inside, while workers at Port Metro Vancouver and in the surrounding area covered their faces with scarves as they streamed out of their offices.
By early evening, firefighters were able to bring the blaze under control and residents were allowed to leave their homes, though people were warned to stay away from the port.
"Smoke is lessening, but people are encouraged to stay away from the fire area," the City of Vancouver said on its official Twitter account.
With the fire still burning, it was unclear when operations would return to normal at the Port and surrounding businesses.
The blaze sparked a massive emergency response because the burning shipping container contained trichloroisocyanuric acid, a hazardous organic compound that can be an eye and skin irritant. There were no reported injuries.
Port Metro Vancouver evacuated its Centerm container terminal, which is operated by DP World Vancouver, and shut down all port operations on the south side of the Burrard Inlet, including a Canadian Pacific rail line and truck access to various port facilities.
With trains to suburbs east of the city canceled and certain buses detoured to avoid the evacuation area, rush hour commuters scrambled to find alternative transit.
Police, meanwhile, urged nearby residents to stay inside and keep their windows closed. The affected neighborhoods included parts of Vancouver's Downtown Eastside, where many of the city's homeless live.
At one point, the local health authority warned people to cover their mouths and noses with a wet towel when outside, and urged anyone experiencing difficulty breathing to seek immediate medical attention.
The fire department said 21 firefighters were called in to battle the blaze, which was first reported to the Port Authority at roughly 1:40 pm Pacific time (1940 GMT). It was not clear how the fire started.
The Centerm terminal is one of four container terminals in Metro Vancouver. (Reporting by Julie Gordon; Editing by Chris Reese, Leslie Adler, Diane Craft and Ken Wills)