COLORADO SPRINGS, Colo. — Authorities lifted evacuations in a wide swath of terrain outside Colorado Springs on Friday as they said a surprise rain shower helped them expand containment of a wildfire that has destroyed 400 homes.

Just one day after clearing out the Flying Horse neighborhood in northern Colorado Springs, officials allowed people back into at least 1,000 houses. They also re-opened an eastern swath of the nearby Black Forest area in El Paso County.

Incident Commander Rich Harvey said the Black Forest Fire — the most destructive in Colorado history — is now 30 percent contained. It was only 5 percent contained Thursday.

The fire, in which two people died while apparently trying to escape their home, began Tuesday during record-setting heat and tinder-dry conditions. Officials warned it still could flare up again if the weather shifts.

Crews say they were better prepared to take on the flames because of lessons learned fighting last year’s Waldo Canyon Fire, a similarly devastating blaze that devoured hundreds of homes and killed two people only a few miles away.

When the Black Forest, a thickly wooded rural region north of Colorado Springs, began to burn, authorities swiftly evacuated tens of thousands of people from an area larger than the Denver metropolitan area.

They immediately began hand-counting destroyed houses to get information out to nervous homeowners. And they rushed federal troops and aircraft into action, cutting the red tape that had grounded those resources a year ago as smoke clouds billowed over Colorado.

Within an hour, El Paso County had its emergency operations center up and running and summoned aircraft from nearby Peterson Air Force base. Rep. Doug Lamborn called the federal center in Idaho that coordinates western firefighting to speed up the process of clearing the planes. Gov. John Hickenlooper mobilized the Colorado National Guard, and troops began to help secure the rapidly growing evacuation zone.

‘‘We’ve done it all before and so there was no question,’’ said Nicola Sapp, El Paso County budget officer. ‘‘Everybody jumped right in.’’

The cause of the blaze is under investigation.

Before the fire got out of hand, authorities evacuated people miles away, sending deputies door-to-door to ensure everyone left. They remembered the speed at which last year’s fire spread.

‘‘That’s one thing I’ll never forget — how fast that Waldo Canyon Fire moved,’’ said El Paso County Sheriff Terry Maketa, who was bowled over by how rapidly help arrived this week.

The latest blaze raced through the rural reaches of the metro area, doubling in size overnight and charring at least 400 homes. The bodies of two people were found inside their garage Thursday, their car doors open as if they had been about to flee.

Some Waldo Canyon evacuees endured days without knowing whether their houses survived. So Maketa sent deputies in at night to survey neighborhoods. It was a painstaking, risky process as ashes smoldered around them while they strained to determine the addresses of charred properties. About 24 hours later, the department began releasing the addresses of houses that were lost.

It might take two weeks to get a perfect count, but the sheriff decided to err on the side of rapidly releasing information.

‘‘I’d rather disappoint one person, but get it right to another thousand,’’ Maketa said.

On Friday, firefighters were aided by some rainfall in the burn area.

Hickenlooper toured the zone and said he was happily drenched.

‘‘I’m soaking wet and I’m a little chilly, but I’ve never been so happy to say this,’’ he said.

The fire zone remained at 25 square miles, thanks to lighter winds and firefighters’ efforts to stamp out flare-ups. Sheriff’s deputies patrolling for looters directed crews to dozens of hot spots.

Harvey is the federal official who also oversaw the battle against the Waldo Canyon Fire. He said it was just coincidence that Colorado Springs saw two such destructive blazes in 12 months.

‘‘This could happen anywhere,’’ he said.

Still, the coincidence is a reminder of the challenges of tamping down wildfires across the West, especially with growing populations, rising temperatures and a historic drought.

Developers describe Black Forest as the largest contiguous stretch of ponderosa pine in the United States — a thick, wide carpet of vegetation rolling down from the Rampart Range that thins out to the high grasslands of Colorado’s eastern plains. Once home to rural towns and summer cabins, it is now dotted with million-dollar homes and gated communities as a result of the state’s population boom over the past two decades.

Waldo Canyon was one of the last subdivisions in Colorado Springs, bumping up directly against the pine-clad wilderness of the Rocky Mountains.

Other fires burned in Colorado, California and New Mexico. A southern New Mexico fire reached the historic mining town of Kingston, but an official said crews protected buildings there.

In Canon City, 50 miles southwest of Black Forest, the 5-square-mile Royal Gorge Fire was 40 percent contained and evacuation orders were lifted. A 350-acre fire sparked by lightning in Rocky Mountain National Park was 30 percent contained.