PLEASANT HILL — A 56-year-old homeless man who tried to keep warm by lighting a candle inside a nylon tent was airlifted to a hospital in critical condition early Monday morning after the tent went up in flames, police said.

Police were called to the corner of Contra Costa and Taylor boulevards at 4:19 a.m. after witnesses reported seeing a nude man who appeared to be crawling on the sidewalk, police said.

Police said they found his encampment, and that the man had apparently tried to light a candle, which ignited the flammable nylon.

No structures were damaged, and the flames had been extinguished by the time fire crews arrived to help the victim, police said. The man was burned severely on his legs, torso and arms, and he was airlifted to the UC Davis’ Firefighters Burn Institute Regional Burn Center, where he remains in critical condition.

A man who called 911 to report the injured victim said he was on his way to the gym just after 4 a.m. when he spotted a dark figure near a rock wall at the corner. The man was bloody and caked with mud, said the caller, a man named Leo who declined to give his last name. The man’s eyes stood out in the dark, reflecting off the car’s headlights as he passed him on the street.

When the driver flipped a U-turn to confirm what he saw, the man had crawled into the bike lane and was reaching his arms into the street as if to ask for help.

“He stretched his hands out, kind of like a zombie,” Leo said. “That early in the morning, I didn’t know what to expect. All I knew is that he needed help.”

Lavonna Martin, Contra Costa County’s acting director of homeless services, said that the county expands its capacity at its Richmond and Concord shelters by 20 beds to 184 during the winter months. During particularly cold snaps, such as this weekend, the shelters receive and grant additional requests to shelter people.

“We don’t want to see anyone risking their health and dying on the streets, we want to be sure people are safe and aren’t out there exposed,” said Martin, adding they do not want to see incidents such as Monday’s “sad and tragic” burning.

In Pleasant Hill, the temperature was 31 degrees at 4 a.m., about the time the incident took place, according to the National Weather Service. The overnight low, about an hour before sunrise, was 28 degrees. The forecast is for the low 30s Monday night.

Martin said workers focus on spreading the word that there are available beds or space.

Advocates also try to provide tips for the homeless who prefer to stay outdoors to wear layers, hats and scarves and wrap themselves in extra blankets.

Otto Warmbier was arrested in January 2016 at the end of a brief tourist visit to North Korea. He had been medically evacuated and was being treated at the University of Cincinnati Medical Center when he died at age 22.