Since the outbreak of the Libyan revolution in 2011, which saw the intervention of NATO countries and the toppling of Muammar Gaddafi's regime, international involvement in Libya has gradually escalated. Although some Western states took a step back in recent years, there has been growing intervention by other countries such as the United Arab Emirates (UAE), France, Turkey, Russia and Egypt, which have all been looking to secure their own interests in the post-Gaddafi era.

The Tripoli-based Government of National Accord (GNA), which was formed in 2015 through a UN-brokered agreement approved by the Security Council, has struggled to establish control over the country. Although it is the only governing body which has been recognised by the United Nations, it has been undermined by foreign intervention. Formally, the GNA has been supported by the United States and the European Union, but its main backers in recent years have been Italy, Turkey and Qatar.

The UAE, Egypt and to a certain extent France and Russia have all been supporting renegade military commander Khalifa Haftar, who since 2014 has been trying to take power in Libya through military force. The military operation he launched in April 2019 to take over the capital Tripoli, has further complicated the situation.

The conflict has been dragging on for nine months and the dynamics of international involvement has been shifting rapidly with significant external factors coming into play.

Although Haftar pledged to take the Libyan capital quickly, he failed to do so and was forced to seek additional support from his allies. After a visit to Moscow last year, a few hundred Russian mercenaries, mostly from the private military company Wagner Group, were sent to aid his war effort. Over the past few months, their number increased to 1,500.

Earlier this month, Russian President Vladimir Putin admitted there are Russian fighters in Libya, but claimed they do not represent the state and are not paid by the Russian government.

In the face of another offensive on Tripoli, the GNA requested help from its backers and Turkey responded. In November, the two signed memorandums of understanding, allowing for maritime and military cooperation between both countries. In January, Turkish President Recep Tayyip Erdogan announced the deployment of troops to Libya "to support the legitimate government and avoid a humanitarian tragedy".

The Trump administration seems to be content with Turkey playing a leading role, which may be why the US has become less involved. Washington has had limited diplomatic engagements through the US ambassador to Libya as well as the deputy national security adviser for the Middle East and North Africa, Victoria Coates, who has held several meetings with both camps in the past three months.

The Turkish military entrance into the conflict is not likely to be met by an escalation of involvement from Egypt, although this would exacerbate the conflict if it were to happen. Some Egyptian analysts, while condemning the Turkish intervention in Libya, have indicated that it is unlikely for Egypt to face off with Turkey militarily.

Libya's neighbour Algeria, which has just had a new president elected, has also become more vocal about getting involved in resolving the conflict, reiterating that the GNA is the legitimate government and that Tripoli is a red line. Algiers opposes Haftar's campaign and is perceived as balancing off the Egyptian involvement.

The main European players, namely Italy and France, have had to take a backseat in the past year. Italy lost much of its credibility and influence in Libya after its recent failure to host talks between Haftar and the head of the GNA, Fayez al-Sarraj. On January 7, Italian Prime Minister Giuseppe Conte tried to organise a surprise meeting between Haftar and al-Sarraj in Rome, but the latter refused to attend.

Currently, Turkey and Russia seem to be trying to work together to resolve the conflict, as they have become the two key international players in Libya. The two managed to broker a ceasefire between the GNA and Haftar's forces which came into effect on January 12.

The following day, al-Sarraj and Haftar met in Moscow to sign an official open-ended ceasefire agreement. The latter, however, decided to pull out of the talks.

Amid this uncertainty and persisting tensions, on January 19, a conference will be held in Berlin to attempt to move the peace process in Libya forward. It will be attended by the two warring sides, as well as representatives of the five permanent members of the UN Security Council as well as Italy, Turkey, Algeria, Egypt, the UAE and the Republic of Congo, which chairs the African Union's special commission on Libya.

Whether Italy and France can use the Berlin conference to seize back the initiative in the Libyan conflict from Turkey and Russia remains to be seen. For now, the shift in dynamics on the ground has established Ankara and Moscow as the main powerbrokers.

The Turkish military presence in Libya will mean that the GNA is in a much stronger position to survive the onslaught by Haftar. This is likely to cause Egypt and the UAE to review their strategy on Libya and they may abandon their hopes of imposing a military solution through Haftar.

The deal struck between Erdogan and Putin ultimately means that both sides in Libya will need to compromise and realise that there is no way for either side to achieve a victory through military means. This should hopefully hasten the end of the current conflict and pave the way for political dialogue to negotiate a long-term political solution in Libya.

The views expressed in this article are the author's own and do not necessarily reflect Al Jazeera's editorial stance.