A taxi driver has been arrested after he allegedly stabbed a policeman with a screwdriver in Sydney's west this morning.

Two officers in a patrol car stopped the taxi just before 6:00am (AEST) at Mount Druitt because it had a shredded tyre.

Police say the taxi driver got out and charged at the officers with a screwdriver.

He allegedly stabbed a constable in the chest during a violent struggle.

The officer's colleague tasered the driver before arresting him.

Police say the injured officer was lucky to escape with a minor chest injury.

He is expected to be discharged from Mount Druitt Hospital this morning.

His alleged attacker is also at the hospital being assessed while under police guard.

Police say the man in his 30s will be charged when he is released from hospital.