Germany is expanding its military cooperation with the Saudi regime, despite the country's involvement in conflicts across the Middle East. The German Defense Ministry confirmed on Wednesday that Saudi Arabian officers would be traveling to Germany to be trained by the Bundeswehr - a deal would be signed in the coming weeks, news agency DPA reported.

Defense Minister Ursula von der Leyen was on her first visit to Riyadh on Thursday to hold talks with the Sunni kingdom and finalize the agreement, which would involve between three and five officers taking part in training programs every year.

In return, the Bundeswehr would send a liaison officer to the Riyadh headquarters of the Saudi-led "Islamic Military Counter Terrorism Coalition," an alliance of 39 Muslim countries founded last year to fight the "Islamic State" militia.

Enemy of my enemy

Saudi Arabia is thought to have pushed for closer cooperation with Germany since 2015, but the training deal has been held up by long legal negotiations. A spokesman for the Defense Ministry told DW that the Bundeswehr offers officer training to a number of different militaries. "For us it's a completely normal mechanism," he said.

Exactly what kind of training the Bundeswehr will provide, for how long, and whether or not the Saudis would pay for it, remains a matter of negotiation, the spokesman added. "There is no concrete plan about what will happen," he said. "As a rule, the states who send soldiers to us say which courses they want them to take part in, and then we look whether we can take the soldiers within our available capacity. I know we offer good training, and I suppose it's got around."

Von der Leyen made her first trip to Saudi Arabia as Defense Minister

Sebastian Schulte, the Germany correspondent for military magazine Jane's Defense Weekly, thinks the deal with Saudi Arabia is more a foreign policy tactic than a matter of military cooperation.

"In terms of what German military and security advisers can actually bring to the table ... remains unclear, as Saudi Arabia has a functioning security apparatus," he told DW.

"Of course, one can always learn from each other, but the entire move and the actual size of the security advisory package is more political than practical," he added.

Schulte also thinks there are some political pitfalls. "Whether Germany actually wants increased security ties with Saudi Arabia is a whole other question for the politicians to answer," he said. "Saudi Arabia is not exactly radiating stability in the region, all the while continuing to harbor a questionable attitude towards another country that Germany considers a strategic partner: Israel."

Selling arms into a war zone

Saudi Arabia is one of Germany's most morally compromised partners, and peace activists have long criticized Germany's decision to continue to sell weapons to what they view as a religious dictatorship.

Saudi warplanes have been bombing Houthi rebels in Yemen since 2015, part of an 18-month conflict that the United Nations says has cost the lives of around 10,000 people. In early October, a Saudi airstrike on a funeral in the rebel-held capital of Sanaa left 140 people dead and over 525 people wounded.

Saudi Arabia has been bombing Yemen for months

The problem seems clear to Berlin too: according to "Der Spiegel" magazine, an internal memo from von der Leyen's department described Saudi Arabia as a "difficult, but central partner in the region."

For its part, Saudi Arabia also seems to be trying to cement new alliances in Europe. "Following an increasing reluctance by the US to be involved in the Middle East, Saudi Arabia appears to be diversifying its security architecture, seeking to draw a primary European power closer to its chest," he said.

Saudi Arabia has proved one of Germany's best customers over the years. According to the Campaign Against Arms Trade (CAAT), Germany sold around 2.6 billion euros ($2.8 billion) worth of military equipment to the Saudis between 2001 and 2014, including ammunition, tanks, military boats and military vehicles. In 2008, Riyadh also acquired a license to manufacture Heckler & Koch's G36 assault rifle.

German Economics Minister Sigmar Gabriel has said he would try to limit military exports to Saudi Arabia, but in July this year he approved the sale of 48 more military patrol boats to the country.

On Thursday, von der Leyen is scheduled to meet Mohammad bin Salman Al Saud, the country's defense minister, deputy prime minister, and the most powerful man in Saudi Arabia after his father King Salman. Von der Leyen is also expected to meet Saudi women during the trip, as well as businessmen connected with the "Vision 2030" economic development project.