He was dismissed and executed in 1474, allegedly because of Mehmed's son, prince Mustafa. Mahmud had been at loggerheads with Mustafa after divorcing his second wife for spending a night in the same house as Mustafa during Mahmud's absence on campaign in 1473. Mustafa's death later in 1474 was even attributed by later accounts to poisoning by Mahmud.[19]