Roads were blocked in Ellenbrook this morning as WA Police including tactical response group officers dealt with an unfolding situation involving a person with a firearm.

There were roadblocks on Marella Road and Railway Parade near the Ellenbrook Speedway and police asked people to avoid the area.

A man in his 20s has since been taken into custody.