The vessel was seized earlier this month by British Royal Marines off the coast of the British Mediterranean territory on suspicion of violating sanctions against Syria.
"At a private meeting of the Supreme Court on an application by the Attorney General, the Court has extended the period of detention of the vessel, Grace 1, for a further 30 days and has set a new hearing for 15 August 2019," the Gibraltar government said on Friday.
The issue has stoked tension in the Gulf and Britain last week said it had fended off Iranian ships that tried to block a British tanker in the region. However, both sides have said they do not want the situation to escalate.
British foreign minister Jeremy Hunt said Britain would facilitate the release of the Grace 1 if Iran gave guarantees that the tanker would not go to Syria, once the issue had followed due process in Gibraltar's courts.
On Thursday, Gibraltar's Chief Minister Fabian Picardo held a "constructive and positive" meeting with Iranian officials in London to discuss the tanker.