A man celebrating the Fourth of July holiday in the US has died after he tried to launch a firework off the top of his head, the second man killed in strikingly similar accidents in the past week, police say.

Devon Staples, 22, had been setting off fireworks with friends in the backyard of a friend's home in Calais, in the state of Maine, when the accident occurred on Saturday night, local time.

Devon Staples, 22, died in a fireworks accident in Maine. Credit:Facebook

Stephen McCausland, a spokesman for the Maine Department of Public Safety, told the Associated Press that Mr Staples placed a firework mortar tube on his head and set it off. He died instantly.

Police said the friends had been drinking alcohol before the accident.