(CNN) China will remain the "primary challenge" to the United States military for as long as a century, warned President Donald Trump's nominee for chairman of the Joint Chiefs of Staff on Thursday.

China had learned from watching the US go to war in the Middle East, and was using those lessons to advance the development of its own military, said current Army Chief of Staff General Mark Milley at his confirmation hearing before the Senate Armed Services Committee.

"China went to school on us," Milley said, responding to a question from Democratic Sen. Tim Kaine of Virginia.

"They watched us very closely in the First Gulf War, the Second Gulf War. They watched our capabilities. And in many many ways, they have mimicked those, and they have adopted many of the doctrines and organizations."

Milley was fielding questions about how he would function as the President's principal military adviser and handle the pressure of delivering his own opinions in the Oval Office.

Read More