An “armed and dangerous” Florida teen wanted in connection with the death of his grandmother was detained by US Border patrol agents — as he made a desperate bid to escape to Canada.

Jacksonville Sheriff’s Office announced late Friday that Logan Mott, 15, was stopped near Buffalo, NY– hours after remains were discovered buried in his backyard.

Officials in Florida started looking for Mott and his grandmother, Kristina French, 53, Wednesday after they failed to pick up his father from the airport.

The teen was in the care of his grandmother while his dad, a Jacksonville Sheriff’s Office corrections officer, was on vacation with his girlfriend.

When the dad got back to his Neptune Beach home he found it ransacked with weapons missing. His mother’s home was also ransacked and her 2015 Dodge Dart was gone.

The teen was spotted on surveillance video in Pennsylvania driving the missing car on Thursday.

Early Friday, officials found a body that matched Kristina French’s description in a shallow grave in the teen’s backyard. Officials are waiting for an autopsy for a positive identification.

They announced Logan Mott was wanted for auto theft and was a person of interest in his grandmother’s death, saying he was considered “armed and dangerous.”

U.S Customs and Border Protection nabbed him as he was trying to enter Canada hours later.

“We are relieved that he is safe and in custody and we just ask for everyone to give us time to sort out what happened,” the teen’s mother, Carrie Campbell-Mott said in a statement to Action News Jax. “No matter what, Logan is our child and we love him… We want to find out what happened to Kristina and we need time for that to happen.”

She said a Jacksonville detective will fly to meet Logan on Saturday.

With Post wires.