Undated (AP) _ A roaring forest fire veered away from Mount Rushmore on Thursday after chasing a thousand residents and tourists from the area, while another huge grass fire was stopped 10 miles short of the Alaska pipeline.

The fire that began in Custer State Park Monday night had burned 13,000 acres by Thursday evening.

''The objective today was to keep the fire from spreading to the north toward Mount Rushmore. That was accomplished,'' said Bob Miller, commander of the fire teams.

Miller said firefighters who would be on the lines Thursday night would use bulldozers and other means to try to stop the fire from spreading to the south and west. ''Tonight we do a direct attack,'' Miller said.

Visitors were allowed to return to Mount Rushmore on Thursday morning, but it was accessible only from the west. Superintendent Dan Wenk said smoke was visible in the distance but there was no smoke at the memorial itself.

''The fire behavior was so extreme and erratic that the fire line was lost several times'' during the night, said Richard Hohmann, a spokesman for the state division of forestry.

Tourism department employees manned telephones to find accommodations for people displaced by the fire, said Susan Edwards, state tourism secretary.

''Our message on the national level is, 'Hey, if you're planning to come out here, come out,''' Edwards said. ''The fire is affecting less than 1 percent of the Black Hills.''

In Alaska, 72 firefighters gained the upper hand after a three-day battle 126,000-acre fire in the center of the state.

''Their goal has been to stop the fire from getting closer to the pipeline,'' said Sue Mitchell, an information officer for the Bureau of Land Management. ''So far, they seem to have been successful. They have the head of the fire corraled between two creeks and a fire line.''

Alyeska Pipeline Service Co. spokesman Tom Brennan said the pipeline stands in a large, cleared right-of-way, is constructed of thick steel that has been heavily insulated and was not susceptible to serious damage even if the fire had reached it.

Firefighters also reported progress in their attempts to contain a 53,230- acre fire burning since Saturday in the Yukon Flats National Wildlife Refuge, 25 miles northeast of Fort Yukon.

At the Waring Mountain fire, a 40,000-acre blaze 35 miles southwest of Ambler, Alaska, 221 firefighters had completed nine miles of fire lines. The west side of the fire has been contained by Kuchuk Creek, Mitchell said.

Elsewhere in a dry and fire-prone country:

- Low winds and cooler temperatures helped to contain a 1,300-acre fire ignited by fireworks in Wyoming's Bridger-Teton National Forest on Thursday. A fire line was completed Wednesday afternoon, but ''we still have a ways to go before we call it controlled,'' said forest spokesman Fred Kingwill.

He said no structures were damaged, but one firefighter was hospitalized Tuesday with burns on his hands, arms and chest.

However, a new fire possibly sparked by lightning was rapidly burning near the Bridger Wilderness east of Pinedale, Wyo. It jumped from just 4 acres in size to more than 100 acres in less than two hours, said Betty Holbrook, fire information officer in Pinedale.

- In Yellowstone National Park, three fires covering nearly 1,900 acres of backcountry were being allowed to burn themselves out.

- Firefighters gained control of a 1,650-acre fire in Wyoming's Shoshone National Forest, said incident commander ''Tut'' Anderson. The fire was started by lightning two weeks ago.

- A 920-acre brush fire in the Los Padres National Forest in California was nearly encircled Thursday as firefighters made progress against the slow- moving but stubborn blaze.

- Firefighters gained the upper hand Thursday on Utah brush and range fires that charred a total of 4,650 acres in three separate areas, including 850 acres in Zion National Park.

Crews declared the Zion blaze, which burned more than two weeks, contained at 5:30 p.m. MDT, said Park Superintendent Harry Grafe. Crews contained a 3,500-acre fire of unknown cause that broke out late Wednesday on Bureau of Land Management and private land about 3 miles north of Beryl near the Nevada border in southern Utah.

- A fireworks-sparked forest fire that had already consumed 200 acres near Moosic, Pa., was surrounded by firemen, while the tenth fire reported to the state Bureau of Forestry's Lackawanna District since July 1 broke out.

- Townley Bergmann, chief of special projects for the Kentucky Division of Forestry, said 26 timber fires were reported Tuesday. ''My prediction is that we'll keep rocking along with about the same number of fires each day until we get some rain,'' he said.

The fire near Mount Rushmore shot billows of smoke so high its pall was visible 160 miles away in Pierre, the state capital, and the flames briefly threatened the park's Game Lodge, where Presidents Coolidge and Eisenhower spent summer vacations.

The fire, fed by drought-dried timber and grass in Custer State Park and the Black Hills National Forest, was within three miles of Mount Rushmore before turning south, said Hohmann.

Pennington County sheriff's officials knocked on doors in the tourist town of Keystone and at the memorial asking people to leave early Thursday, said Jerry Hagen, fire information officer with the U.S. Forest Service. He estimated 300 to 400 people were being evacuated; 600 were evacuated earlier from Custer State Park.

Employees at Mount Rushmore and park officials also were asked to leave, Hagen said.

Menashe and Abigail Barzilai of Winnipeg, Canada, their month-old baby and two other children were among the 170 people who spent the night at a Red Cross shelter. ''We left all of our things in a motel, including the passports,'' Barzilai said.

''Now we can't go back,'' Mrs. Barzilai said. ''About the fire, I wasn't worried, but about the passports I was and I don't have anything for the baby.''

Authorities believe lightning started the fire in the north-central part of the 73,000-acre park Monday night. It was not spotted until Tuesday afternoon.

Wenk said the biggest threat from the fire was the possibility that it would ruin the scenic setting of the monument. He said the granite of the monument could endure the flames, but perhaps might have been discolored by smoke.

Jerry Hagen, fire information spokesman, said he also had no fear of the carvings suffering structural damage. The biggest problem would be blackened vegetation, he said. ''We would have to live with that for a long time.''