A man who lit an RCMP detachment on fire in the Okanagan this past July has been found not criminally responsible.

On July 25, two Mounties were working inside the Osoyoos detachment when they smelled smoke. They went outside and found the entrance of the detachment was on fire.

While they were outside, police saw a man returning with flammable items. Officers recognized him as 28-year-old Joseph McArthur-Pereira, from Osoyoos. He was immediately arrested.

Security footage obtained and posted to YouTube by Osoyoos Times shows the July incident unfolding. A man can be seen pouring what appears to be gas near a door and around the perimeter of the building. He then lights it on fire and flames quickly spread around the detachment's exterior. 

After his arrest, McArthur-Pereira was charged with arson endangering life and mischief causing danger to life.

He appeared in B.C. Provincial Court on Thursday and was found not criminally responsible after psychological assessments were completed. 

He'll remain in custody in hospital until his mental health review is complete.