An investigation is underway after a man died while in police custody.