(Adds detail from investor call, analyst comment, updates shares)
SAN FRANCISCO, Feb 4 (Reuters) - Alphabet Inc's fourth-quarter revenue and profit beat Wall Street's expectations on Monday but sharply higher spending, as it added data centers, cloud engineers and marketed its services heavily during the holidays, worried investors.
The company's shares, which have risen almost 17 percent over the past six weeks, fell 2.3 percent to $1,114.60 in after-hours trading.
Partly because of the higher spending, Alphabet reported an operating margin of 21 percent in the fourth quarter, down from 24 percent a year ago.
"Google saw a steep decline in operating margins," said Richard Kramer, analyst at Arete Research "They have plenty of cash to invest, and $7 billion in capex is a huge spend."
Alphabet Chief Financial Officer Ruth Porat said capital expenditures this year would "moderate quite significantly," speaking to investors and analysts after results were announced.
The company has authorized a plan to buy back an additional $12.5 billion worth of its shares, Porat also said.
Facebook Inc's better-then-expected fourth-quarter results last week had lifted expectations for Alphabet as they suggested that concerns about a global economic slowdown may be overblown.
Alphabet's fourth quarter revenue rose 22 percent from a year ago to $39.28 billion, compared to the average expectation of $38.93 billion among analysts tracked by Refinitiv. About 83 percent of the revenue came from Google's ad system, chiefly mobile search and YouTube, the company said on a call with analysts.
The company had $31.07 billion in total fourth-quarter costs and expenses, up 26 percent from last year. Capital expenditures rose 64 percent compared to last year, up to $7.08 billion.
Porat said increased operating costs stemmed from licensing content for YouTube, expanded data center operations and Google's hardware business.
A run-up in spending has reflected Google's efforts to boost staffing on its cloud computing division, promote its consumer devices and YouTube subscription packages and acquire office buildings in Silicon Valley and New York.
Quarterly profit was $8.95 billion, or $12.77 per share, compared with a $3 billion loss a year ago. That compared to analyst estimates of $7.69 billion, or $10.87 per share.
The loss last year related to a one-time charge from new U.S. tax rules, while earnings since then have benefited from new rules about valuing Alphabet's dozens of investments in external startups. Fourth-quarter earnings also benefited from a $1.3 billion unrealized gain related to a non-marketable debt, Alphabet said. (Reporting by Arjun Panchadar in Bengaluru; Editing by Anil D'Silva and Bill Rigby)