Residents and officials expressed relief that the second of two escaped murderers from a prison in the Adirondack mountains was captured Sunday near the Canadian border in upstate New York.

"I feel like I can sleep tonight," Cathy Leffler told the Associated Press, outside a hospital in Malone where David Sweat was taken. "Life can go back to normal."

An Amish dairy farmer said Sweat was captured on her property near a tree line, just feet from an electrified fence where the cows graze.

Verba Bontrager, 38, who has run her family's farm in Constable for the past nine years, said she was chatting with visitors inside when she heard two gunshots. Her children and a family friend went outside, saw a caravan of police cars and ambulances, and learned from a trooper that Sweat had been captured.

She said her children had been home alone earlier, and even though she knew police were looking for Sweat, she never thought to be worried. Now, she said, they're a little shaken.

More On This...

"I think it's kind of hard for them to go back to bed and sleep because of everything that went on," Bontrager said. "We're all kind of scared, I guess."

At a diner on US 11, townspeople voiced support for the invasion of law enforcement, and a sign at a fast-food restaurant thanked them. Other places offered free meals to police. 

Around 3:20 p.m. Sunday, state police Sgt. Jay Cook was alone when he spotted Sweat walking down a road in the town of Constable, about 1½ miles from the Canadian border. Sweat cut toward a line of trees and refused commands to stop, authorities said.

Fearing Sweat could make it to the tree line and disappear into the forest, Cook fired two shots and hit Sweat in the torso, New York State Police Superintendent Joseph D’Amico said.

“It was a very courageous act,” Gov. Andrew Cuomo said at a press conference Sunday afternoon, which was filled with cheers from the audience.

A photo captured Sweat wearing a hooded parka and camouflage pants, with smears of blood on his face. As authorities carried him away to a hospital in Malone, he coughed up blood

Sweat was transferred to the Albany Medical Center on Sunday night and medical director Dr. Dennis McKenna said he was in critical condition.

"I can only assume," D'Amico said, "he was going for the border."

When authorities interview Sweat, they might hear more details about how he and his fellow inmate pulled off an escape that will undoubtedly become legend.

Sweat, 35, had been on the run since he and Richard Matt broke out of the Clinton Correctional Facility in Dannemora, N.Y., on June 6. The manhunt for the two killers involved 1,200 law enforcement personnel. Matt was gunned down by authorities on Friday.

“This was an unprecedented coming together of law enforcement on every level,” Cuomo told reporters.

State police had flooded the area Saturday night after developing evidence that Sweat was there.

Sweat, who was unarmed, has not been formally interviewed by investigators as of late Sunday, but any information he provides could be critical to the investigation, Clinton County District Attorney Andrew Wylie said.

Sweat will be charged with escape, burglary and other charges, Wylie said. The inmates are suspected of breaking into some of the region's many cabins during their time on the lam. Wylie said prosecutors would wait for Sweat to recover before charging him.

“The nightmare is finally over,” Cuomo said. “It took 22 days but we can now confirm…Mr. Matt is deceased and Mr. Sweat is in custody is in stable condition.”

The search for the escaped killers was initially concentrated around the prison and a rural community where search dogs had caught the scent of both men. The search had since been expanded to neighboring counties, and, while authorities said there was no evidence the men had gotten out of the general area, they conceded they could have been almost anywhere.

"It's a little unnerving, him being so close," said Constable resident Trevor Buchanan. "I'm just glad it's over."

 D'Amico said the men may have used black pepper to mask their trail; he said Sweat's DNA was recovered from pepper shakers found at one camp where the fugitives may have spent time.

"We did have difficulty tracking so, you know, it was fairly effective in that respect," D'Amico said.

On Friday, Matt, 49, was killed by a border patrol agent near the town of Malone.

An autopsy showed Matt had been shot three times in the head, state police said Sunday.  Officials say Matt also had bug bites on his legs, blisters and minor abrasions that would be expected for someone who had been living in the woods.

Matt smelled of alcohol after a border patrol agent killed him Friday, according to the Buffalo News. He was also sick, possibly after consuming spoiled food or bad water, a law enforcement source told the newspaper.

The indication Matt was ill came after searchers found soiled underwear at a burglarized cabin Wednesday, the Buffalo News reported.

A DNA test showed the underwear belonged to Matt, the paper said.

The paper also reported that based on his clothes and appearance, it looked like Matt had not bathed in a long time and had spent a great deal of time on the lam in the outdoors.

Authorities said Matt was shot by a border patrol agent when he failed to comply with orders to show his hands. A 20-gauge shotgun was found on Matt, though he didn’t fire it at officers, authorities said.

"They verbally challenged him, told him to put up his hands. And at that time, he was shot when he didn't comply," D'Amico said at a news conference late Friday.

The breakthrough came Friday shortly before 2 p.m., when a person towing a camper head a loud sound and thought a tire had blown out. Finding the tire intact, the driver drove another eight miles before discovering a bullet hole.

Authorities converged on the location where the sound was heard and discovered the smell of gunfire inside a cabin. D’Amico said there was also evidence someone had fled out the back door.

A noise -- perhaps a cough -- ultimately did Matt in. A border patrol team discovered Matt, who was shot after failing to heed a command to raise his hands.

"As we were doing the ground search in the area, there was movement detected by officers on the ground, what they believed to be coughs. So they knew that they were dealing with humans as opposed to wildlife," he said.

Mitch Johnson said one of his best friends checked on his hunting cabin in Malone Friday afternoon and called police after noticing the scent of grape flavored gin as soon as he stepped into his cabin and spotting the bottle that had gone untouched for years resting on a kitchen table.

At the Clinton Correctional Facility, Sweat was serving a sentence of life without parole in the killing of a sheriff's deputy in Broome County in 2002. Matt was serving 25 years to life for the killing and dismembering of his former boss.

In their escape, Matt and Sweat used power tools to saw through a steel cell wall and several steel steam pipes, bashed a hole through a 2-foot-thick brick wall, squirmed through pipes and emerged from a manhole outside the prison.

A civilian worker at the prison, Joyce Mitchell, has been charged with helping the killers flee by giving them hacksaw blades, chisels and other tools. She has pleaded not guilty.

On June 24, authorities charged Clinton correction officer Gene Palmer with promoting prison contraband, tampering with physical evidence and official misconduct. Officials said he gave the two prisoners the frozen hamburger meat Joyce Mitchell had used to hide the tools she smuggled to Sweat and Matt. Palmer's attorney said he had no knowledge that the meat contained hacksaw blades, a bit and a screwdriver.

The Associated Press and Fox News' Rick Leventhal contributed to this report.