Tengku Razaleigh challenged Dr. Mahathir in the 1987 UMNO leadership election, teaming up with former Deputy Prime Minister Musa Hitam, who had in the year prior resigned from Dr. Mahathir's cabinet owing to some conflict with the Prime Minister. Mahathir's then Deputy Prime Minister, Ghafar Baba, contested against Musa for the Deputy Presidency. This led to UMNO being split into two camps, i.e. "Team A" and "Team B" with Dr. Mahathir and Razaleigh as leaders of the respective camps. Dr. Mahathir managed to retain his party president position by a mere 43 votes and Musa lost by 40 votes. It is worth noting that of the two living former Prime Ministers at the time, Tunku Abdul Rahman and Tun Hussein Onn, both had thrown their support behind Razaleigh. The election was held on a Friday, and coinciding with the Friday prayers, it is alleged that many used this opportunity to "buy" votes from delegates in order to have them cast a vote for their leader.