* MSC offers 16.75 euros per A-share

* Would hold 49.9% if it obtains all A-shares

* City of Hamburg to retain majority

BERLIN, Sept 13 (Reuters) - MSC, the world's biggest container shipping company, is offering to buy almost half of the main operator of Hamburg port, in a deal that could allow city authorities to retain control of Germany's biggest port in the face of other takeover interest.

Switzerland-based MSC and the city of Hamburg have agreed a deal in which MSC will make a cash offer of 16.75 euros ($17.99) per share to acquire all listed class A stock in logistics company HHLA, which runs most of the port.

That is well above Tuesday's closing price of 11.54 euros and, if the offer is taken up in full, would give MSC a 49.9% stake in HHLA at a cost of about 1.26 billion euros.

The city of Hamburg, which currently owns a 69% of HHLA's A shares and all of its unlisted S-shares, would hold 50.1% via the S-shares.

News of the deal comes after logistics billionaire Klaus-Michael Kuehne, who owns a stake in shipping group Hapag-Lloyd, told a German newspaper that he would like to take over HHLA.

"Word on the street is that the port and HHLA are on the decline. That worries me," he told Frankfurter Allgemeine Zeitung in an interview published earlier this week.

HHLA said its management board would review the offer from MSC, which is privately owned by the Aponte family.

According to Hamburg mayor Peter Tschentscher, the deal would not require German federal government approval, given that it is with a European company.

HHLA earlier this year sold a stake in one of its three terminals in Hamburg port to Chinese shipping firm Cosco , in a deal that was met with protests within Germany's government coalition and from abroad over concerns about increasing Chinese influence.

($1 = 0.9312 euros) (Writing by Friederike Heine and Maria Sheahan Editing by Jason Neely and Mark Potter)