Officials at Yosemite National Park took the extraordinary step of closing the landmark wilderness Friday because of concerns about the coronavirus.

Neighboring Sequoia and Kings Canyon national parks followed suit with a closure of the main entrance station late Friday afternoon while other national parks in California and across the country debated whether to take the same drastic measure.

Over the past week, fears about the spread of the coronavirus have prompted piecemeal shutdowns of visitors centers, hotels and other facilities in parks nationwide. Park officials have faced pressure from local and state authorities to limit large gatherings and help contain the worldwide pandemic. But, until now, the giants of the National Park Service had resisted large-scale closures.

“The health and safety of our visitors, employees, volunteers, and partners at Yosemite National Park is our number one priority,” read a statement from Yosemite on Friday. “We will notify the public when we resume full operations and provide updates on our website and social media channels.”

Roads into Yosemite were shut down at 3 p.m., visitors were prohibited from entering and those in the park were being notified that the park was closing. Park officials did not say how long the closure would last.

While four people who work in Yosemite are being tested for the coronavirus, no cases of COVID-19 have been confirmed there. Health officials in the region said the closure was prompted not out of fear that the virus would spread in the park but because the rural area does not have adequate medical resources should someone get sick.

Yosemite officials did not respond to requests for comment on the closure, but the park’s statement said the move came at the request of the local health department.

“Given the limited services and really the limited medical community, it would be unfortunate to have a serious case of COVID-19 in the park,” said Dr. Eric Sergienko, the head of the Mariposa County Health Department, who recommended the shutdown. “It creates a public safety issue that goes beyond the day-to-day falling off of cliffs.”

Sergienko also said that should someone get ill, the region is not equipped to trace the origin of the virus and make sure it is fully contained.

None of the counties along Yosemite’s western border — Mariposa, Tuolumne and Madera — have reported a case of COVID-19, which Sergienko said bodes well for the park.

“The likelihood of a case in the park is not zero but less than in the Bay Area,” he said.

Yosemite remained open only to employees and people who live in the park.

Officials at Sequoia and Kings Canyon national parks closed the area’s main entrance station at Ash Mountain on Highway 198. The park’s Big Stump entrance near Grant Grove on Highway 180 remained open because it also serves national forest lands, though all park facilities there were shuttered.

The Bay Area’s Golden Gate National Recreation Area shut down many parts of the park earlier in the week, including Alcatraz Island and visitor centers in the Presidio and at Lands End, the Marin Headlands and Muir Woods. It remained to be seen whether the closure would be extended to public lands and trails.

Many employees and advocates of the National Park Service have been asking park officials to broaden the shutdowns in the interest of public safety and protecting natural resources.

“Amid California’s shelter-in-place directive, the National Parks Conservation Association urges national parks in the state to follow Yosemite’s lead and consider stronger closures,” said Ron Sundergill, senior regional director for the NPCA, in a statement. “Protecting park staff, visitors, resources and surrounding communities is paramount.”

Kurtis Alexander is a San Francisco Chronicle staff writer. Email: kalexander@sfchronicle.com Twitter: @kurtisalexander