Convicted murderer and escaped inmate David Sweat was shot near the Canadian border Sunday by a New York state police officer, according to authorities.
"The nightmare is finally over," New York Gov. Andrew Cuomo said at a press conference late Sunday. "It took 22 days but ... let's give a big applause to the men and women of law enforcement who did a great job."
Sweat was wounded but is alive and was taken into custody, according to the New York State Police. He was spotted by New York State Police Sgt. Jay Cook at about 3:20 p.m. in the town of Constable, less than six miles from the Canadian border, police said in a statement.
Cook thought Sweat looked suspicious and told him to "freeze," and when he didn't, Cook shot and injured him in twice in the torso, before he could run to the tree line, officials said. Sweat was then handcuffed, taken into custody, and placed on a gurney, the sources said.
He was transported to the Alice Hyde Medical Center in Malone, New York, law enforcement sources said. His condition is unknown, according to police.
New York's Sen. Chuck Schumer told The Associated Press that no officers were hurt during the shooting and capture.
Cuomo said that, in addition to grilling Sweat on how the escape plan took shape, officials will be conducting an investigation into the prison.
"It was the first escape in 100 years, but one escape is one escape too many," the governor said. "Anyone who we find who was culpable and guilty of cooperating in this escape will be fully prosecuted.
He added, "Today ends with good news. These were really dangerous, dangerous men, both Matt and Sweat. These were killers ... We could not tolerate them being on the loose."
Sweat was set to be transferred to Albany Medical Center — because it's a "Level-1 trauma center" — later Sunday evening, according to a hospital spokesman.
The news of his capture comes more than three weeks after Sweat broke free from Clinton Correctional Facility, and two days after Richard Matt, 49, the man he escaped with, was killed by law enforcement.
Matt was shot dead in Malone, which is about 40 miles away from the prison and about six miles south from where Sweat was shot. New York state police said Friday that investigators believed the inmates were attempting to cross the Canadian border.
At the press conference with Cuomo, New York State Police Superintendent Joseph D'Amico said the same.
"Where Sweat was I can only assume he was going for the border, he was that close," D'Amico said. "And we couldn't be more happy that we apprehended him. It's been a long three weeks."
More than 1,300 law enforcement officers were combing Malone and Duane Sunday, increased from the 1,200 who were searching in the same area the day before. Officials had said that there was no evidence to suggest that Sweat was in the area, but nothing indicated otherwise.
The exhaustive search began when Matt and Sweat broke out from the maximum security portion of the Dannemora prison on June 6 in a sophisticated and brazen plan in which the prisoners cut holes in the backs of their cells with power tools.
Two prison workers have been arrested in connection with the escape.
Joyce Mitchell, who worked as an instructor in the prison's tailor shop, was arrested June 12 and charged with a felony count of promoting prison contraband and a misdemeanor count of criminal facilitation. She was planning to be a getaway driver for the inmates after the early morning break out, but got cold feet, officials have said.
A prison guard Gene Palmer was later arrested and charged with promoting prison contraband in the first degree, two counts of tampering with physical evidence and one count of official misconduct. Palmer told police that he allowed the prisoners outside of their cells and gave them supplies but never thought they would escape.
Sweat was serving a life sentence for killing Sheriff's Deputy Kevin J. Tarsia on July 4, 2002. Tarsia's sister-in-law, Lisa Tarsia, posted on Facebook after Sweat's capture that her brother-in-law "can once again Rest in Peace."
"Feeling so thankful for all the members of Law Enforcement that have spent the last 3 weeks away from their families to track down these animals," she wrote.
Matt was serving 25 years to life for brutally killing and dismembering his former boss.
Both were added to the U.S. Marshals Service's 15 Most Wanted Fugitives list during their time on the lam, and $25,000 each was offered as reward money on top the $50,000 offered by New York for information leading to either inmate.
Cuomo said Friday that the weeks-long search had been "expensive," although he couldn't give a number. Whatever the cost, Cuomo said there was "no doubt, in my opinion, that it's worth it."
This story originally appeared on NBCNews.com