Metro Manila (CNN Philippines) -- Here's one rare story of victory.

The race for mayor of Bocaue, Bulacan was decided by luck from a coin toss.

Canvassing officials there resorted to choosing heads or tails after Joni Villanueva and Rival Jim Valerio received exactly the same number of votes: 16,694.

In a phone interview with CNN Philippines, Villanueva said they considered other means to settle the tie.

"In fact we were thinking of having a recount or do a manual counting just to avoid the toss coin," Villanueva said.

According to a resolution by the Commission on Elections, candidates are allowed to break a tie by drawing lots. According to Section 240 of the Omnibus Election code, "the board of canvassers, after recording this fact in its minutes, shall by resolution, upon five days notice to all the tied candidates, hold a special public meeting at which the board of canvassers shall proceed to the drawing of lots of the candidates who have tied and shall proclaim as elected the candidates who may be favored by luck, and the candidates so proclaimed shall have the right to assume office in the same manner as if he had been elected by plurality of vote."

Luck favored Villanueva, who won the best-of-five coin flips. She is the sister of one of the winning senatorial candidates, Joel Villanueva.

Also read: Philippines elects first transgender woman to Congress