Germany has closed its embassy in Ankara and its general consulate in Istanbul because of the threat of a possible imminent attack, the foreign ministry has said.

The ministry said the German school in Istanbul has also been shut due to an "unconfirmed warning".

The consulate said in an email seen by Die Welt that the facilities had been shut as a precaution but warned German citizens to stay away from the areas.

Foreign Minister Frank-Walter Steinmeier told reporters in Berlin that they were responding to "concrete" evidence of an attack.

He said: "Yesterday evening, our security authorities received several concrete and very serious leads that terror attacks against our German representations in Turkey were being prepared".

On Tuesday, Germany had issued an alert to its citizens in Ankara warning of an "imminent attack".

It comes as a car bomb attack killed 37 people and injured at least 125 more in the capital on Sunday.

The Kurdish militant group TAK claimed responsiblity for the deadly suicide attack in which two of its own were killed.

In pictures: Ankara bombing Show all 30 1 /30 In pictures: Ankara bombing In pictures: Ankara bombing Family members and relatives grieve for victims of a car bombing outside the forensic morgue in Ankara In pictures: Ankara bombing Men hold Turkish flags over the coffin of a car bombing victim during a commemoration ceremony in a mosque in Ankara In pictures: Ankara bombing Relatives of Feyza Acisu one of the victims who was killed in an explosion cries during the funeral in Ankara In pictures: Ankara bombing In pictures: Ankara bombing Relatives of Murat Gul one of the victims who was killed in an explosion pray near the coffin covered with Turkish flags during the funeral in Ankara In pictures: Ankara bombing Forensic experts investigate the scene of an explosion the day after a suicide car bomb ripped through a busy square in central Ankara killing at least 34 people and wounding 125, officials said, the latest in a spate of deadly attacks to hit Turkey In pictures: Ankara bombing Forensic experts investigate the scene of an explosion, the day after a suicide car bomb ripped through a busy square in central Ankara In pictures: Ankara bombing Turkish police secure the area as scenes of crime officers search the area after an explosion in Ankara In pictures: Ankara bombing Relatives of victims who were killed in an explosion mourn in front of forensic medicine institution in Ankara In pictures: Ankara bombing People carry an injured person on a stretcher at the scene of a blast in Ankara In pictures: Ankara bombing Relatives of people wounded in an explosion in Ankara, Turkey, react as they arrive at a hospital to see their loved ones In pictures: Ankara bombing Emergency workers are seen on a bus at the explosion site in Ankara In pictures: Ankara bombing Forensic experts investigate the scene of an explosion in Ankara In pictures: Ankara bombing A burning car after a blast in Ankara In pictures: Ankara bombing Emergency services attend the scene in central Ankara's Kizilay Square In pictures: Ankara bombing In pictures: Ankara bombing Dogan Asik, 28, who was blown away from inside a bus by a powerful explosion speaks at the explosion site in the busy center of Ankara In pictures: Ankara bombing Emergency services help an injured person following after an explosion in Ankara's central Kizilay district in Ankara In pictures: Ankara bombing The wreckage of a bus and a car are pictured at the scene of a blast in Ankara In pictures: Ankara bombing Forensic services and firemen work around burnt out taxi vehicles after a blast in Ankara In pictures: Ankara bombing In pictures: Ankara bombing In pictures: Ankara bombing In pictures: Ankara bombing At least 27 people were killed and 75 wounded in an explosion in the Turkish capital Ankara in what appeared to have been a car bomb attack according to Ankara governor Mehmet Kiliclar Getty In pictures: Ankara bombing Medics carry an injured person at the explosion site in the busy center of Turkish capital, Ankara AP In pictures: Ankara bombing The bomb exploded close to bus stops near a park at Ankara's main square, Kizilay. The news channel said the explosion occurred as a car slammed into a bus, suggesting that the blast may have been caused by a car bomb AP In pictures: Ankara bombing Emergency workers work at the explosion site in Ankara Reuters In pictures: Ankara bombing Emergency workers work at the explosion site in Ankara, Turkey Reuters In pictures: Ankara bombing A destroyed bus is seen in the street after an explosion in Ankara EPA In pictures: Ankara bombing Emergency workers work at the explosion site in Ankara, Turkey Reuters

The group said the attack had been aimed at security forces and they did not mean to kill civilians.

Ankara has now been hit by three bombings in a space of five months, ratcheting up security fears across the city and Turkey.

In a statement posted online, the group described the car bombing, which occurred on Sunday, as revenge for security operations in the mainly Kurdish southeast that have been under way since July, in which hundreds of civilians, security forces and militants have been killed.

The Turkish armed forces carried out air strikes against Kurdish rebel strongholds in northern Iraq hours after the attack.

The state run Anadolu news agency said nine F-16s and two F-4 jets raided 18 positions of the Kurdistan Workers' Party, or PKK, including the Qandil mountains where the group's leadership is based.

Police detained at least 11 people in connection with the attack on Monday.