Over the last 15 years, China’s international diplomacy has marked it as something of a geopolitical adolescent, like a teenager who suddenly has the physical strength and desires of an adult, but not the experience and savvy to manage them.

But recent behavior suggests that China’s foreign policy is maturing, and that Chinese Communist Party leaders may finally be coming to terms with the fact that a global power must behave differently than a peripheral developing country. Whether Beijing continues on this path will go a long way to determining whether China’s rise remains peaceful, or turns threatening.

Since the start of the 21st century, China has undergone a massive transformation. From a mostly poor, inward-looking, developing country, it has become a major global economic power with interests and activities all over the world. Countries, organizations and individuals everywhere have had to scramble to adapt. But no one has been more confused about and unprepared to handle the implications of this change than the Chinese themselves, and the sophistication of their international relations has lagged behind their overall power as a result.

Although the Communist leadership has for years aspired to Great Power status, it was less clear on how a Great Power should behave. China often came across as “insecure, confused, selfish and truculent.” With its major global rival, the United States, China was an important commercial partner, but also a cyber thief and trade nuisance; with its immediate neighbors, it was often thuggish, bullying and unresponsive to even minor requests; and nowhere was its lack of nuance in its international relations more obvious than on the African continent.

Though China’s investment in Africa has indeed been massive, totaling tens of billions of dollars, much of the value of this investment has been captured by Chinese firms and African elites, not the local African population. For large infrastructure construction projects, China would often import hundreds or thousands of Chinese laborers to Africa, rather than hire allegedly less-skilled local workers. Further, what local labor was employed at construction, mining, logging and oil projects often complained of substandard working conditions and pay. And of course, the projects themselves largely involved the transfer of raw materials back to China and the sale of Chinese goods in Africa, in an uncomfortable mirror-image of European colonialism of a century earlier. This monomaniacal focus on commercial gain may have served Beijing’s short-term interest in economic growth, but it brought ever-greater scrutiny and criticism from African and international sources.

In its repeated efforts to brush aside, shut down and undermine this kind of criticism, the Communist leadership in Beijing usually returned to the line that China supports “non-interference” in the internal affairs of other countries: If African political leaders were willing to go along with China’s requests, it was not for the rest of the world to question. A relic of the Mao years, this idea had grown out of the original anti-imperialist and anti-colonialist impulse that was at the heart of the early People’s Republic: let the developing world manage its own affairs and focus on what it decides is important, not what outsiders think should be important.

But in recent years, this philosophy’s frequent use has begun to ring somewhat hollow internationally, as China’s global presence has become so broad and deep that its own interests have become tied up in questions of the internal affairs of other countries. For instance, the 2011 election in Zambia turned in large measure on a huge Chinese copper project in the country that opposition candidates said exploited the population; China sought to influence the results through lobbying and political work, an effort completely at odds with its traditional policies.

Further, as various African political and economic leaders across the continent begin to organize against the more pernicious effects of Chinese influence, Beijing and its agents are finding that its reputation for unfairness with the population is not a mere afterthought and that ignoring local wishes can come with a steep cost.

Finally, more Chinese firms and workers are finding themselves operating in countries with significant local danger. Just last month, Chinese citizens were killed in the terrorist attack on the Radisson Blu hotel in Mali. Beijing is now being forced to admit that it has a stake in the security dimension of its relationship with African countries and may actually have a role as a security provider on the continent. All of this easily ranks as “interference” in other countries’ domestic affairs.

For most of the last 10 years, Communist leaders in Beijing have seemed unfazed by these criticisms. But as the recent, second “Forum on China-Africa Cooperation” (FoCAC) concluded in Johannesburg last month, it appeared from Chinese President Xi Jinping’s statements there that China is beginning to recognize that its interests are not only commercial, but reputational and security-related as well. In addition to promising billions more in development aid, China is committing itself to industrializing Africa, rather than simply selling it goods it produces at home. And in pledging to commit its own troops to peacekeeping missions — as well as establishing a permanent naval base in Djibouti, its first-ever overseas base — Beijing is showing a commitment to provide security rather than just use it.

It remains absolutely possible that these promises will never be fully realized, and that Chinese Communist Party leadership will reverse course and return to its strident and uncompromising tone. The entrenched interests inside the Communist party that favor such an approach are strong, and the more flexible approach is more expensive, slower, and one with which China has less experience.

It is even a more open question whether Chinese diplomacy could effectively export this more “mature” foreign policy to other regions, like Central Asia or Latin America, where there is less of an obvious power differential between China and its counterparties, let alone to Europe, Japan or the United States. But in even making these small, halting steps towards a less petulant, more inclusive foreign policy, China is showing that it just might be willing to make the compromises that will be necessary if it is ever to become a true Great Power.