Libyan navy and allied militia forces have surrounded a North Korea-flagged tanker just outside an eastern port held by rebels, a navy spokesman said.

The Morning Glory has loaded crude oil worth $30 million at the Es Sider port, bypassing Tripoli authorities, despite a government threat to bomb it should it sail away.

Navy spokesman Ayoub Qassem told Reuters the tanker was currently in what was known as the waiting area outside the port for ships planning to depart at some point.

"Boats from the navy and revolutionary forces have surrounded the tanker," he said.