In this work, a dynamic metallic filamentary resistive switch (MFRS) is used to quench the avalanche in a single photon avalanche photodiode (SPAD). The experimental results and simulations are consistent with an interpretation that, the MFRS is in a high resistance state when the avalanche occurs. This enables the quenching of the avalanche sufficiently within a short time. This increases the voltage drop across the MFRS, which switches the MFRS to its low resistance on-state and the recharging process is greatly accelerated because of the lowered R-C time constant. This leads to a sharp avalanche pulse shape and a fast detection speed.