A standoff that lasted more than two hours in the Wal-Mart parking lot on U.S. Route 2 in Palmyra ended peacefully Friday when a suicidal man was taken into custody after he had sat in his pickup truck armed with a gun, according to police.

The 28-year-old Corinna man, whom police did not immediately identify, was taken from his truck around 1 p.m. and handcuffed on the ground next to it after he apparently surrendered. He was taken into custody several minutes after the standoff ended, according to a news release issued by Steve McCausland, spokesman for the state Department of Public Safety. It did not specify charges.

In a news conference after the standoff, Maine State Police did not release details about what led to the situation. They said police negotiators worked to convince him to surrender. McCausland later confirmed that the man was taken to a hospital for observation.

State police Major Brian Scott, Lt. Sean Hashey and Sgt. Blaine Bronson said no shots had been fired at the scene, where several friends and family members of the man arrived and spoke with negotiators.

Police got a call shortly after 10:30 a.m. that there was a suicidal man in the Wal-Mart parking lot, and they immediately responded, directing customers from the parking lot and locking down the store, troopers said. Both Route 2 entrances to the parking lot were blocked off.

In all, 30 to 40 police officers were on the scene from the Maine State Police, Penobscot and Somerset sheriff’s departments and the Newport Police Department. Some, in tactical team gear and armed with long guns, were stationed at the corners of area buildings.

Hashey said about 100 customers were locked down inside Wal-Mart, which is near the Newport town line, from the onset of the standoff. Part of busy Route 2 was closed around noon, and the adjacent Lovley’s Motel, close to where the man sat in his truck, was evacuated.

David Gray, a Dexter attorney, waited across the street in the parking lot of Maine Fireworks during the standoff. His wife had called him from inside Wal-Mart on a borrowed phone — she’d left hers in her car — and told him she didn’t know what was going on, but no one could leave.

“She’s OK,” he said. “I was at my office. As a doting husband, I said I’d come down.”

His wife, Lauren, 53, a legal secretary, said later Friday in a phone interview that she had left work to do a couple of errands and had stopped at Wal-Mart briefly around 10:30 a.m., but just before leaving the store was told no one could exit.

She and dozens of other customers milled around inside the store’s foyer until they were asked to move farther inside the store where it would be safer.

“The Wal-Mart employees were awesome,” Lauren Gray said. “They handed out waters and crackers, and the Dunkin’ Donuts folks came around with little samples of things. One of the Wal-Mart employees was walking around with crayons and pictures for the kids to color.”

She said employees also offered folding chairs to customers.

According to Gray, an elderly man worried about his dog that he left in his car was relieved when three police officers came into the store, escorted him out to retrieve the dog and then re-entered the store with him and the dog. She said everyone immediately cheered and clapped.

She said they were never told officially why the lockdown occurred, but they had heard a man was outside with a gun. However, she said, no one was panicking or frightened. Everyone just knew they were inside for the duration — however long that might be — and they decided to make the best of it.

“I just want to say that law enforcement presence deserves the highest form of kudos that any of us could give them,” she said. “I never felt like I wasn’t safe — ever.”

She said she was exhausted afterward, and it was a strange experience — not something she expected to encounter when she got up in the morning. While it involved a serious situation, it was in many ways a positive reflection on humanity, she said.

The employees handed out diapers to people with babies, and those who had bought cold or frozen goods were given bags with their names written on them that were stored in coolers or freezers and handed out after the standoff ended.

Everyone was friendly to one another, she said.

“I heard a couple of people say, ‘Oh, let’s be Facebook friends after this.’ Clearly everyone was concerned about what was happening outside, but it was not a negative thing inside that place,” Gray said.

Merchants in the area along Route 2 that was blocked to traffic expressed concern about the man in the pickup truck as they watched the police activity during the standoff.

Just after noon, Benjamin Beers, a salesman at Newport Motor Sports, said he had heard the man in the truck was despondent and he hoped all would turn out well.

“It’s sad because it’s just a cry for help,” Beers said. “If he wanted to kill himself, he’d be dead. I think he just wants someone to know he’s hurting.”

Vikki Viles of Canaan sat in a pickup truck in the Dollar Tree parking lot across Route 2 from Wal-Mart, waiting for the store to reopen, as she needed to pick up a prescription at the pharmacy, she said. Unaware of what was happening at Wal-Mart, she said she had a dentist appointment in the afternoon and was required to take an antibiotic beforehand. After waiting nearly two hours, Viles called her dentist’s office and had the prescription transferred to a different place.

Meanwhile, state police issued a press release around noon confirming that they were dealing with “a police emergency of a man inside a vehicle in the parking lot,” but it did not confirm he had a gun.

“The incident is confined to the vehicle,” the news release said. “No one has been injured.”

The man was in a black pickup truck with an extended cab and a tool box in its bed, parked at the back of the parking lot near Lovley’s Motel. He could be seen occasionally talking on a cellphone. After his surrender, he was laid on the ground and handcuffed before being led away by state police.

A man parked in his vehicle near Maine Fireworks during the standoff said he was a Wal-Mart manager and was to report to work at 2 p.m., but got there early to help in any way he could after he was allowed into the store. He declined to give his name.

A manager inside the store said after the standoff ended that she could not comment, but supplied a phone number for Wal-Mart media relations.

Charles Crowson, senior manager for Wal-Mart corporate communications based in Bentonville, Arkansas, issued an email early Friday evening in response to a request for comment.

“We take the safety of our customers and associates seriously at all times,” it says. “We were notified by state police of the situation in our parking lot and agreed to close until the matter was resolved.”

Emergency radio reports at the start of the standoff said customers were trying to get into Wal-Mart. Police warned that once in, they would not be let out until the incident was resolved.

Amy Calder — 861-9247

[email protected]

Twitter: @AmyCalder17