Police officers are seen in front of a cargo ship with containers at a port in Qingdao, Shandong province, China April 6, 2018.

CEOs became less optimistic about the U.S. economy as the Trump administration ratcheted up trade tensions with key partners, according to the latest Business Roundtable survey.

The Business Roundtable's CEO Economic Outlook Index fell by 5.7 points in the second quarter to 89.5. It also marked the fifth straight quarter of declining optimism. Capital expenditure plans, CEO plans for hiring and expectations for sales also fell from the previous quarter.

"Business leaders are ready and eager to invest and hire in the United States," Joshua Bolten, president and CEO of the Business Roundtable, said in a statement. "Yet, the uncertainty over trade policy is making it more difficult for companies to invest and operate confidently."

Trade tensions have been rising since last year as the Trump administration tries to correct what it feels are unfair trade conditions between the U.S. and other countries. Most noticeably, the U.S. has gone after goods from China and Mexico, two key trading partners.

Late last month, President Donald Trump threatened to impose a 5% levy on all imports from Mexico that eventually could have escalated to 25%. Trump said last week that the two countries struck a deal to avoid those tariffs that included Mexico curbing immigration into the U.S. But while U.S.-Mexico trade tensions have been quelled for the moment, U.S.-China trade fears remain.

The U.S. hiked tariffs on $200 billion worth of Chinese goods in May to 25% from 10%. China retaliated by raising levies on $60 billion worth of U.S. imports. Concerns over tighter trade conditions and their impact on the global economy and corporate profits led to a massive sell-off in May. The S&P 500 plunged more 6% last month.

To be sure, the Business Roundtable said the CEO Economic Outlook Index remains above its historical average of 82.6. Hiring and capital investment plans are also above historical levels.

The survey was also conducted between May 16 and June 3, which Bolten called "a turbulent few weeks for U.S. trade relations with China and Mexico."

J.P. Morgan Chase CEO Jamie Dimon said lawmakers need to "work together to enact policies that will encourage inclusive growth, innovation and opportunity in the United States. That includes investing in infrastructure and workforce training, reforming our immigration system and expanding free and fair trade."

Subscribe to CNBC on YouTube.