An Anchorage police officer and a man were wounded late Wednesday in a gunbattle at a city-owned campground that has been turned into an outdoor shelter for homeless people.

The shooting occurred the same day another bear attracted to unsecured food was killed in the campground.

Two officers were conducting a security check at Centennial Campground in east Anchorage when they came across a man who was suspected of earlier eluding police, a statement from the Anchorage Police Department said.

"At some point during the encounter, the suspect produced a handgun and gunfire was exchanged," the statement said.

Both officers fired at the man, who was shot several times. One officer was also wounded, police said.

Both were taken to the hospital and are expected to survive, police said. The statement said the officer sustained serious injuries. The second officer was uninjured.

ALASKA WILDFIRE SEASON SETS RECORD

The state’s Office of Special Prosecutions will investigate to determine if the officers’ use of force was justified. Following that, the Anchorage Police Department’s Internal Affairs division will review the shooting to see if there was any violation of policy.

The officers have been placed on four days of administrative leave, per department policy, and their names will be released 72 hours after the shooting.

Tents are shown on July 6, 2022, inside Centennial Park

An Anchorage police officer and a man were wounded in a shootout at the city-owned campground that has been turned into an outdoor shelter for homeless people. Pictured: Tents are shown inside Centennial Park, a campground recently set aside for the city's homeless population, in Anchorage, Alaska.  (AP Photo/Mark Thiessen, File)

Earlier Wednesday, Alaska Wildlife Troopers killed a black bear that authorities believed was going into tents looking for food, the fifth bear killed at the campground this month. Officers from the Alaska Department of Fish and Game killed four black bears in the campground on July 5.

TRUMP OFFERS SCATHING REBUKE OF ELON MUSK DURING ALASKA RALLY WITH SARAH PALIN: 'HE’S ANOTHER BULL---- ARTIST'

The municipality of Anchorage closed its mass shelter at Sullivan Arena at the end of June and set up the campground for people without homes.

Unsecured food at the campground situated at the edge of the Chugach State Park in what officials call prime bear habitat has enticed bears.

The city has provided bear-proof food storage containers and enhanced security, but food issues remain a problem in the camp where about 200 people are living.

ALASKA KIDS SERVED FLOOR SEALANT INSTEAD OF MILK AT ELEMENTARY SCHOOL SUMMER PROGRAM

"It’s a continual large-scale attractant. It’s not just the occasional tent that has it, it seems to be a lot of the tents that have it," Dave Battle, Anchorage area biologist for the Department of Fish and Game, told the Anchorage Daily News.

"Unless we can keep attractants out of tents, almost any bear that happens by there is going to end up in the camp and in tents," he said. "It’s a very unfortunate situation."