Bharatiya Janata Party National President Amit Shah, Information and Broadcasting Minister Smriti Irani, and senior Congress leader Ahmed Patel won Rajya Sabha seats from Gujarat on Wednesday, according to India Today. The results came at the end of a night of drama that culminated in the Election Commission invalidating two ballots by Congress MLAs who had cross-voted for the BJP, giving Patel just enough votes to return to the Upper House for the fifth time.

The Gujarat election officer said that all 176 MLAs had cast their votes. Two of those, however, were invalidated after Bholabhai Gohil and Raghavjibhai Patel – the Congress MLAs who cross-voted and then showed their ballots to Amit Shah – were found to have violated secrecy rules.

The BJP has 122 members in the Gujarat Assembly. The Congress’ strength had dropped to 45 from 51 after six of its MLAs, including Rajput, quit the party in July. Earlier in the day, it seemed as if the BJP might have been able to earn enough votes to win all three seats and keep Patel, known to be close to Congress President Sonia Gandhi, out of the Rajya Sabha.

Following the voting, however, the Congress election agent Shaktisinh Gohil complained about the actions of the two MLAs who had revealed their ballots to Amit Shah. In the aftermath of this complaint, the Election Commission received several delegations from both parties, including five Union Ministers from the BJP who demanded the counting of votes without any being nullified.

At 11:30 pm, after reviewing the video evidence, the EC concluded that the two MLAs had violated rules regarding the secrecy of ballots and declared them invalid. Though the EC ordered counting to begin immediately afterwards, the BJP gave a further verbal complaint and attempted to stall the process. The counting of votes eventually only began at 1:45, stretching into the early hours of Wednesday.