A two-year manhunt for an alleged California sex offender ended in a shootout in Manhattan's bustling Greenwich Village on Monday, leaving two U.S. marshals and one police detective wounded and the suspect dead, authorities said.

The law-enforcement officials arrived at Smoking Culture, a smoke shop, after receiving information that 32-year-old Charles Mozdir was working there, authorities said.

Authorities...