It happened outside the city limits of Dos Palos on Ida Street near Leonard Avenue around 3 p.m.
Deputies say someone called 911 to report that a man armed with knives was on the roof of a home, trying to set it on fire.
Dos Palos officers say they felt threatened by the suspect and shot at him, but did not hit him.
Merced County sheriff's deputies eventually used a tazer to catch the man after he jumped off the roof.
He was taken to the hospital to be checked out before being booked into jail.