警官による暴行事件はあやうく暴動に火をつけるところでした。

English Translation

The police brutality incidents nearly set off a riot.

暴動に「火をつける」is understandable but sounds a bit unnatural. My alternative translation is:

警官による暴行事件は、危うく暴動に発展するところでした。
警官による暴行事件は、下手をすると暴動に発展しかねなかった。

下手をすると is a frequent expression, meaning “in the worst case scenario, it could be…”.
発展する literally means “to evolve itself into…”. 発展する is frequently preceded by incidents or situations.