Eddie "Pops" Miles Jr., is also charged with criminal contempt and aggravated criminal contempt.
The incident began Sunday morning just before 9 a.m. when police were dispatched to a report of a domestic at 207 Washington Ave., Batavia.
When patrols arrived, Miles allegedly threatened to shoot police. That caused police to establish a perimeter, evacuate neighboring homes, and initiate a reverse 9-1-1 call to other residents with a shelter in place notice.
Then Miles allegedly started a fire inside the apartment where he was staying with his girlfriend.
His girlfriend managed to climb out on the roof of the front porch and escape with the assistance of police officers.
While the apartment burned, city firefighters could only shelter behind their trucks.
Eventually, Miles surrendered and climbed down a ladder at the back of the building.
There was also a warrant out for his arrest. He is charged with two counts of criminal sale of a controlled substance, 3rd, and two counts of criminal possession of a controlled substance, 3rd.
He also still has charges pending from 2017.
Miles was arrested in August for allegedly putting his arm around the neck of another person and injecting a dog with an unknown purple liquid.
In July, he allegedly took a car belonging to another person without permission.
He is being held in the Genesee County Jail without bail.