Mexico’s no. 2 broadcaster TV Azteca has seen its legal woes go from bad to worse in recent weeks.

One government agency is piling on multi-million dollar fines for its refusal to run political ads for free while another is ordering it to pull the plug on its digital terrestrial platform, Hi-TV.

The two, long-brewing issues plaguing the web are coming to a head as the Federal Electoral Institute (IFE) begins to hand down exponentially larger fines for failing to run legally mandated political spots and the Transportation and Communications Secretariat (SCT) readies the ax for Hi-TV, a free-to-air platform similar to the U.K.’s Freeview.

The IFE brouhaha began two years ago with a new law that was designed to level the playing field between political parties by requiring broadcasters to air spots for free in primetime.

Azteca failed to comply and, early last year, IFE hit Azteca with three fines totaling about $450,000. That was a drop in the ocean by comparison to the advertising that Azteca was raking in, so it continued to ignore the ruling.

In July, IFE handed out a then-historic $1.7 million fine followed by a $5.5 million fine in January. On Feb. 24, it issued a fine of $9.6 million for failing to run a further 16,092 spots. That’s $17.25 million if you’re counting.

Azteca has so far staved off paying the fines by lodging a variety of appeals. However, it will hit Azteca’s bottom line if it ever has to pay them.

This battle is playing out while it fights to prove the legality of Hi-TV.

Hi-TV gives viewers free-to-air access to all the regular webs plus digital spinoff channels via a set-top box, which the viewer buys with a one-off payment.

However, the regulatory framework for Mexico, which isn’t set to complete the switch from analog to digital for another 13 years, is fairly ambiguous.

The controversy began as soon as the decoder boxes hit the stores in February 2009 and has stirred up a number of side debates, including which federal agency has the authority to approve such matters.

In December, the Federal Telecommunications Commission (Cofetel) declared Hi-TV legal.

But on Feb. 23, SCT chairman Juan Molinar Horcasitas declared it illegal, ordered the service to be shut down, hit Azteca with a $350,000 fine and went so far as to insist the web recovers every one of the 50,000 boxes it has sold.

Frustrated by the ruling, Cofetel commissioner Hector Osuna went to Congress to ask the pols to clarify the jurisdiction between the two bodies.

Azteca has filed lost two appeals over the SCT decision, one with the Supreme Court and another with a lower district court, announced last week.

Azteca maintains it followed the rules for the switch to digital issued in 2004 and that it has the right to further appeal.

The web’s prexy Mario San Roman has vowed to keep Hi-TV going as long as possible, adding that Azteca would comply with the results of the legal battle no matter the outcome.