A pet dog has cornered a burglar at a home in Bertram, south of Perth.

A couple inside the home were woken by someone trying to open their front door about 1:00am (AWST).

Police say they then heard someone jumping over their side fence and their dog began barking in the back yard.

They rushed outside to see their bull mastiff had bailed a man up into a corner.

The dog held him there until police arrived.

The man has been charged with trespass.

Police later found he was wanted on a warrant to return to prison.