RICHMOND — Officials have fully contained a huge fire at the Chevron refinery in Richmond that sent thick black smoke wafting across the Bay Area, raising health concerns and prompting shelter-in-place warnings for thousands of residents.

The fire broke out at 6:15 p.m. and flames and two large plumes of black smoke rose five or six miles into the sky, drifting across the Bay. Chevron spokesman Lloyd Avram said no explosions were reported on-site, but witnesses reported hearing at least four loud booms. Spokesman Brent Tippen confirmed at 10:40 p.m. that the fire had been fully contained.

The shelter-in-place order for the communities of Richmond, North Richmond and San Pablo was lifted around 11:15 p.m., according to Contra Costa County Hazardous Materials Program Director Randy Sawyer. Sawyer said that small amounts of material were still burning on the site, but that smoke was not leaving the refinery property.

Residents can open their windows and doors to allow their homes to air out, Sawyer said.

Officials are still working to determine the cause of the fire, but said the blaze was in their “No. 4 Crude Unit,” which processes diesel crude oil.

Chevron spokeswoman Heather Kulp said crews were investigating a leak in the unit before the fire. Crews realized the leak could not immediately be contained, so moved workers out of the area, and the fire erupted shortly thereafter, she said.

As the fire spread, the refinery activated some flairs — a type of release system that allows pressure to escape, Kulp said.

All refinery employees are accounted for, Chevron said, and no major injuries were reported. One operator was treated at the scene for a burn on his wrist, Kulp said.

Kulp apologized to the community for the distressing incident. A community forum will be held at 6 p.m. Tuesday at the Richmond Memorial Auditorium to discuss the fire.

“I heard a big boom … then the alarms started going off,” said resident Daniela Rodriguez, 23, who was at home nearby when the fire started. “I was getting kind of scared. I went into my backyard and could see a big, dark gray cloud. I saw it was coming from where the refinery is, so I told my mom to lock the windows.”

Even hours after the fire, witnesses reported smells of burning plastic in the air, with residents as far as Oakland and Benicia reporting the foul odor. The county health department was monitoring air quality and said nothing harmful had been detected in the atmosphere so far.

Still, the Kaiser Permanente Richmond Medical Center was treating about three dozen patients in its emergency room who were complaining of respiratory problems, according to a statement from the hospital.

The plume from the fire was an estimated 3,000 to 4,000 feet above ground level, officials said at a news conference late Monday.

“The plume is still high above and not touching down into the community,” said Trisha Asunción, a hazardous materials specialist with the county.

Shelter in place warnings were issued via sirens and phone calls and BART stations in Richmond, El Cerrito Plaza and El Cerrito del Norte stations were closed, but have since reopened.

The shelter in place warnings were issued for Richmond, San Pablo, North Richmond, El Cerrito and North Oakland. Residents were told to stay inside, close their windows and doors and turn off air conditioning and heating units.

Residents were also warned to have duct tape ready should they need to further seal windows and doors. Pets should also be brought inside and all children in sporting activities should be brought inside.

“People who can clearly see the smoke should pay attention and keep out of the smoke and be alert and aware,” said Bay Area Air district spokeswoman Lisa Fasano. “We do have air quality inspectors on scene and we will be taking air samples and will have the results back tomorrow,” she said.

Smoke from the fire could be seen from the Bay Bridge and from Jack London Square in Oakland.

Some people were fearful while others took the fire in stride.

“We heard the sirens go off and I said, ‘Thunderdome blew,'” said Emmett Zediker, 39, an electrician who lives in the North and East neighborhood in Richmond and has been through other refinery fires. “We call Chevron ‘Thunderdome’ because when it blows, it blows. So we cracked open a bottle of vintage wine and we are having an apocalypse party.”

His three friends stayed inside, but Zediker said he was hot and went outside for air. “My friends said, ‘Don’t open the door, don’t breathe,’ but I’m like, ‘Let’s have some more wine.'”

The last time there was an explosion and fire at the refinery was in 2007. There are 1,200 employees at the refinery and all have received training for fires and disasters.

Staff writer Dana Hull contributed to this report.