The U.S. economy grew at a sluggish 1.2 percent pace in the second quarter, according to government data released Friday morning, as businesses cut back on investments and dashed hopes for what economists had expected to be a major bounce back.

The latest data shows an economy pulled in two directions, powered by fast-spending consumers but held back by anxious companies responding to a strong dollar and turmoil overseas.

Tepid growth between the months of April and June was particularly unsettling because it extended a period in which the economy appears to be gradually shifting into a lower speed. For three consecutive quarters, the gross domestic product growth — the broadest measure of output — hasn’t topped 1 to 1.2 percent. The nation hasn’t seen such a meager stretch since 2009.

Though some economists said Friday that the United States is due for a pickup in the second half of the year, the recent weakness could dampen sentiment about the country’s course and push Democratic nominee Hillary Clinton to take a more critical tone about the economy under President Obama. Where Clinton has applauded the nation’s recovery, adding that the United States needs to build a system that “works for everyone, not just those at the top,” the Republican nominee has said the economy is “terrible” and in danger of “massive recession.”

The new data, released by the Commerce Department, also provides a note of caution for the Federal Reserve, which is debating whether to raise interest rates in the latter part of the year.

Economists surveyed by Bloomberg had expected that the United States’ GDP grew at a 2.5 percent annualized pace in the second quarter. The figure fell well below that mark in large part because of slowdowns across the business world: Companies were slower to stock shelves, buy equipment and invest in new infrastructure.

Some economists have said that the United States is fairly well insulated against global turmoil in China and Europe provided American shoppers continue to spend, but the latest numbers suggest that the nation remains vulnerable so long as businesses don’t pick up the pace. While a strong labor market and cheap gasoline prices are bolstering households, businesses are feeling the pressure of weaker corporate profits and a strong dollar that makes foreign goods cheaper within the United States — a challenge to the market share of American producers.

Personal consumption grew 4.2 percent in the second quarter, but nonresidential business investment — a measure of spending on such things as machinery and buildings — fell 2.2 percent. Business investment has declined for three consecutive quarters, something that hadn’t happened previously during the seven-year recovery from the Great Recession.

“Well, it happens during recessions,” said David Berson, chief economist at Nationwide Mutual. “But it’s a rare thing to happen during expansions. And it’s certainly holding the economy back.”

Berson said businesses investment could also be suffering for a variety of other reasons: Some companies might be constrained by regulations. Some might be opting for stock buybacks rather than expansion, figuring that’s what their shareholders prefer.

Even as the United States’ GDP lags, the country has been sending mixed signals about the health of its economy. Hiring is strong but wage growth has been picking up only slowly. While the unemployment rate falls, an alarming number of middle aged workers remain on the sideline — not looking for work, and therefore not counted in the jobless rate.

Separately on Friday, the Commerce Department also said that the economy had grown just 0.8 percent in the first quarter of the year, instead of 1.1 percent as previously estimated. Growth hasn’t topped 2 percent since the second quarter of 2015, but Michael Feroli, chief U.S. economist at JPMorgan Chase, said in the long run, the country is still floating in the range where it has been throughout the recovery.

"To me it looks like more of the same," Feroli said, "but just with a little soft patch here."

During the latest three-month period, growth was also trimmed because businesses slowed in their stockpiling of goods that are waiting to be sold. Companies have curbed their inventories for five quarters in a row. Economists, though, say this behavior could soon swing: Eventually, companies will have to expand the goods on their shelves to keep up with consumer demand. Without the inventory cutbacks, the economy would have grown at 2.4 percent in the second quarter — on par with market expectations.

The demand among consumers, for now, “is providing enough momentum to ward off a recession,” Curt Long, chief economist at the National Association of Federal Credit Unions, said in an email.

The months between April and June were a volatile period in which the United States saw its best month of hiring in a half-year and its worst in six years. Following the conclusion of its meeting Wednesday, the Federal Reserve's Board of Governors said that U.S. economic activity was expanding at a “moderate rate.” Household spending was “growing strongly” even as businesses were cautious about investing.

The implications of Brexit — the vote by the United Kingdom to exit the European Union — probably had little sway on the latest growth data, coming just a week before the end of the second quarter.