Broadcaster STV has seen healthy profits wiped out by the settlement of a dispute brought about by its decision to drop major ITV network programmes.
The company made a pre-tax loss of £6.5m in the first six months of 2011.
The broadcaster reported £13m in one-off costs and charges related to the amicable settlement of the dispute.
STV and ITV had been engaged in a complex legal dispute which stemmed from the Scottish company's decision to drop a number of network productions.
They included the first series of the costume drama Downton Abbey.
But once these exceptional charges are stripped out, the company's underlying profitability actually improved.
It also plans to start paying a dividend for the first time in many years.
STV said trading for the period had been in line with expectations.
Chairman Richard Findlay said: "The wide ranging settlement agreed with ITV removes significant uncertainty and we look forward to a new and constructive relationship.
"The various legacy issues have now been closed out, resulting in a cash positive operating structure going forward."
The £13m worth of exceptional charges included the write-off of legal and other costs of £3.5m together with a further one-off exceptional charge of £9.5m.
Under the terms of the settlement, STV has already paid £7.2m in cash to ITV. STV will pay a further £10.8m - either in programming rights or cash - by June 2013.
Since the dispute ended, STV and ITV have resumed their previous close relationship.
STV recently announced it would be showing the new series of Downton Abbey in the autumn.
But it remains committed to Scottish productions to complement ITV network material.
Although its magazine show The Hour is in the process of being turned from a daily programme at teatime into a weekly peak time production, the company is to introduce a half-hour Scottish news programme at 22.30 BST four nights a week.
Once the one-off charges associated with the end of the ITV dispute are taken out of the equation, STV's underlying profitability improved.
In the six months to the end of June it made an underlying pre-tax profit of £6.5m on turnover of of £47.2m. This compares to £6m on £49.7m for the same period last year.
The company hopes to re-introduce dividend payments for shareholders at the end of the year. The last time the company - then known as SMG - paid a dividend was 2005.
However, it remains cautious about the economic outlook.
It expects its national advertising revenue to perform broadly in line with the ITV Network for the year as a whole but says the regional market - advertising for those who only want to advertise in the STV region - is more challenging.
Last year, its traditional broadcasting business accounted for 93% of the company's revenue - but the firm hopes a third of its money will come from other means by 2015.
STV wants to increase the amount of money it makes from websites and double the revenue at its production business, which makes programmes for other broadcasters including the ITV network and the BBC.
The news came as the company revealed its headline profits had risen slightly in the first half of the year - even though its revenue had actually gone down.