Police said the officer used his weapon to shoot the attacker, who was then taken to hospital.
Police union official Cedric Michel said the attacker was armed with a hammer and targeted a police officer on patrol on the esplanade in front of the cathedral.
The attacker was then “neutralised” by police, he added.
M6 reopens after vehicle transporting sheep overturns following crash between Preston and Lancaster
Lewis Turner inquest: moped rider "travelling at motorway speeds" on residential New Longton road and without fastened helmet before fatal crash
The Old Vicarage Care Home: special measures status for Lancashire care home where resident was left lying on floor after falling out of bed
Preston Brick Veil Mosque inquiry closes as debate rages over whether the place of worship should be permitted
M65 motorway crews strimming verges until 4am keep residents awake at night
It is unclear whether the attacker was acting alone.
Police in the city urged people to stay away from the area.
It is being treated as a terrorist incident.
The incident comes just days after atrocities targeting civilians in London and Manchester