A 32-year-old woman has been shot in the leg after two masked men broke into her home in Carabooda, north of Perth on Thursday night.

The two balaclava-clad men confronted the woman at the home on Kiln Road at 11.20pm.

One allegedly attacked the woman before shooting her in the leg

Both men fled in a car but were arrested a short time later in Tapping.