In the poem "The Rime of the Ancient Mariner", why did the mariner killed

In the poem “The Rime of the Ancient Mariner”, why did the mariner killed the albatross and felt guilty and why did he hung it across his neck?

The mariner killed the albatross as he thought it to be the reason for the wind to die, although the other sailors thought that the bird was associated with good luck. The sudden change of wind and the mist which befell the ship made the mariner realise his mistake and therefore he felt guilty for his actions. The crew members hanged the albatross around his neck as a form of punishment for him and a penance on their part.