Tokyo (CNN) -- One day after praising China for the way it has responded to issues like the U.S. sale of arms to Taiwan, U.S. Defense Secretary Leon Panetta's comments turned more serious and stern Monday.
In an op-ed published in Japan's largest daily newspaper, Panetta wrote, "China is rapidly modernizing its military, but with a troubling lack of transparency."
He went on to criticize China's dealings with some of its neighbors, focusing on China's "increasingly assertive activity in the East and South China Seas."
"Together, the U.S. and Japan will work to... encourage China to play a responsible role in the international community," Panetta wrote.
Just the day before the op-ed was published, Panetta told reporters, "I would commend them (China) for the way that they've handled the news of that sale to Taiwan."
The United States announced a $5.3 billion arms package for Taiwan last month, which includes upgrades to Taiwan's F-16 fighter fleet.
On the same day U.S. and North Korean officials are meeting in Geneva to negotiate a return to talks about North Korea's nuclear weapons program, the defense secretary criticized North Korean for being among countries characterized by "reckless" behavior.
"These include North Korea, which continues to engage in reckless and provocative behavior and is developing nuclear weapons and ballistic missiles, which pose a threat not just to Japan but to the entire region," he wrote in the same opinion piece.
"Together, the U.S. and Japan will work to bring North Korea back to the Six Party Talks."
Panetta attended a series of meetings Sunday in Bali, Indonesia with fellow defense ministers from southeast Asia.