BEIJING — Visits to Beijing this week by top officials from North Korea, Myanmar, and Iran are spotlighting China’s cozy ties with nations widely shunned for human rights abuses and threatening behavior.

North Korea’s supreme leader Kim Jong Il arrived in Beijing on Wednesday for a meeting with Chinese President Hu Jintao that would underscore the influence economic powerhouse China has with Kim’s ostracized regime, which struggles to feed its people.

Beijing is North Korea’s most vital diplomatic ally and economic supporter and is desperate to prevent a chaotic collapse of its hardline communist neighbor. Kim rarely makes foreign trips and his third visit to China in just over a year emphasizes his dependency on Beijing.

On Thursday, Beijing will host a visit from Myanmar President Thein Sein, a former general and prime minister in the military junta that handed power to a nominally civilian government at the end of March. Meanwhile, Iranian Foreign Minister Ali Akbar Salehi stopped in Beijing as part of commemorations of four decades of diplomatic ties.

To many observers, such ties tarnish Beijing’s self-image as a responsible rising power.

But to China, they represent a political kinship in rejecting Western-style democracy as well as the economic benefits of trade with partners whose markets are shunned by the West yet wide open for Chinese investment.

China’s communist leaders are themselves accused of violating rights and locking up its critics and have little patience for Western accusations against similar regimes.

“China views a number of countries in the world as in alliance in not having democracy or sharing Western human rights concepts,” said Michael Davis, a law professor and Chinese politics expert at Chinese University of Hong Kong. “It helps mobilize their legitimacy argument that the Western approach is not the only one.”

China’s Foreign Ministry has refused to confirm Kim’s presence in China, although Premier Wen Jiabao has said China invited him to study, and hopefully adopt, Beijing’s market-oriented reforms. His previous stops during the trip, which began Friday, were said to be economically related.

Previous reform attempts have been abandoned by North Korea and it’s far from clear how much 69-year-old Kim — or his anointed successor, son Kim Jong Un — would be willing to change.

South Korean media said Kim arrived in Beijing on Wednesday morning from the southern city of Nanjing aboard his personal train. A motorcade believed to be carrying Kim and his delegation arrived Wednesday evening at the Great Hall of the People, the seat of the legislature in the heart of Beijing where Hu usually receives official visitors.

In South Korea’s capital, Seoul, President Lee Myung-bak said he thought Kim’s China visits were a positive thing.

“Visiting there often, watching and learning, and China’s assistance — such things would bring about changes,” Lee said, according to the Yonhap News agency.

North Korea’s exchanges with China have grown even more important since South Korea’s conservative government halted unconditional food and fertilizer shipments in early 2008 and suspended almost all trade with the North. The U.N. and other groups also have enacted sanctions to punish the country for violating nuclear agreements.

Iran for its part is under four sets of U.N. Security Council sanctions for refusing to stop uranium enrichment — an activity that can make both nuclear fuel and fissile warhead material. Like North Korea, Iran’s nuclear and missile programs are seen as a threat to its neighbors, while Myanmar’s crackdown on political opponents and ethnic minorities has seen it widely shunned by the international community.

Beijing, with its avowedly noninterventionist foreign policy, takes a different approach, emphasizing the need for continued dialogue and economic engagement. China also has a huge interest in avoiding the kind of unrest that could be unleashed at its borders if one of the regimes in North Korea or Myanmar should fall.

But while these states may seem to have warm relations, they don’t necessarily share deep trust.

North Korea and Myanmar may resent their dependence on China and often seem to want to go their own way, as shown in their unwillingness so far to undertake the economic reforms China is pitching, said Ian Storey of the Singapore-based Institute of Southeast Asian Studies, a think tank that focuses on social, political, economic and security trends.

“China’s influence over these countries tends to be greatly exaggerated,” Storey said.