Police alleged a man wielding a hammer pulled a woman out of her car outside a Napier supermarket, but couldn't steal it because he couldn't put it into gear.
Hawke's Bay Police say a 34-year-old man has been arrested and charged with aggravated robbery over the incident outside Pak 'n Save Tamatea on Sunday.
Acting Detective Sergeant James Forgie said it was a "random attack" and people in public should have a right to feel safe.
"This was a very scary experience for our victim and we are delighted to make a quick arrest."
Forgie said a man allegedly approached the woman sitting in the car and presented a hammer about 7.25pm, demanding she get out.