Online grocer Ocado is on course for the first annual profit in its 12 year history after results showed a big swing in its half-year performance today.

The company, which recently entered into a joint venture with Morrisons to run the supermarket's online operation, made a profit of £7.5 million in the six months to May 18, against a £3.8 million loss a year ago.

Shares still dived 5% today amid fears about future growth in the face of a fiercely competitive supermarket sector.

Even though its average orders rose 15.8% to 161,000 per week in the half year, the average size of a customer's shopping basket slipped to £114.43 from £114.90.

Chief executive Tim Steiner also forecast that online shopping will grow at a slower rate than in recent years, albeit at a faster rate than the wider market.

Ocado, which delivers Waitrose and its own products to much of the UK, faces increasing competition from the online operations of major supermarkets as the industry is dragged into a price war sparked by the growth of discounters.

On the back of Ocado's first-half results, analysts are still forecasting that the business will make its first ever full-year profit since its launch in 2002.

Brokers at Numis estimate it will make a £12.9 million annual pre-tax profit, compared to a £5.1 million loss a year ago.

Ocado added that its Morrisons' deal, signed last July, contributed £20.3 million to sales in the first half of the year.

The launch involved the use of Ocado's recently opened distribution centre in Warwickshire for deliveries through a Morrisons-liveried fleet. The 25-year deal will see Morrisons pay up to £170 million to Ocado.

Ocado said it is braced for challenging industry conditions in the second half of the year and that it would increase its marketing spend.

Mr Steiner added: "We expect that our retail business will continue to grow broadly in line with, or slightly ahead of, the online grocery market."

But Shore Capital analyst Clive Black, a long-time critic of the business, said: "For a small group with a skill set that is supposed to be industry leading, why is Ocado not expecting to shoot the industry lights out?"

Ocado added it was in a good position to sign more joint ventures with other supermarkets who wanted to take advantage of its IT expertise.

The business also said that it rolled out its new online pet store, Fetch, in 2013 and said "sales are now increasing at a significant rate."

The firm will begin building its third warehouse in Andover, Hampshire in the final quarter of this financial year, and expects the site to open by the end of 2015, with the capacity to handle 65,000 orders per week.

To fund its UK expansion the business said it put in place a new three-year £100 million borrowing facility.