By James Ramage

The dollar rose against the euro and the yen on Friday after the U.S. posted strong inflation numbers for April, likely nudging forward market expectations for higher borrowing costs.

Numbers for U.S. inflation increased for a third consecutive month, particularly those that exclude volatile food and energy components, or "core" prices. The Federal Reserve watches inflation numbers closely, alongside labor market data, in determining the health of the U.S. economy and whether to raise interest rates for the first time since 2006.

The dollar strengthened against the common currency, with one euro buying $1.1016 from $1.1172 ahead of the numbers. The greenback has gained 0.8%, rising to a three-week high and erasing early morning losses. The dollar increased to Y121.52 against the yen from Y120.90 beforehand, now trading 0.4% higher on the day.

"This inflation report is good for the dollar," said Vassili Serebriakov, currency strategist at BNP Paribas. "This number suggests that the Fed, at least on the inflation front, is not that far from the threshold for starting to raise rates."

The dollar has proven volatile particularly against the euro since last summer. Many investors bet against the common currency as the European Central Bank began its large-scale stimulus program in March. By mid-March the euro pared some of the dollar's large gains as the U.S. economy muddled through soft first-quarter data while the eurozone began to show signs of recovery and growth.

The dollar has strengthened throughout much of the week, and received a boost after the U.S. consumer-price index, which reflects what Americans pay for goods and services, increased a seasonally adjusted 0.1% last month from March, the Labor Department said. "Core" prices increased 0.3%, the largest gain since January 2013. Economists had forecast overall prices to rise 0.1% and core prices to climb 0.2%.

Stronger inflation numbers join those for jobless claims and housing starts in giving investors a sense that the U.S. economy is pulling itself out of a slump that dragged growth down to just 0.2% for the first three months of 2015. Many in the markets had expected the economy to expand at a healthy pace and for the Fed to raise interest rates, a move that would make the dollar attractive, while central banks in Japan and the eurozone were still easing policy.

When soft U.S. economic numbers persisted into April, some investors pushed out interest-rate expectations into 2016.

Fed-funds futures, which traders and investors use to bet on Fed policies, showed that investors see 61% odds for a rate increase in December, compared with 55% before the numbers, according to CME Group. Investors also see a 46% chance of a rate increase in October, against a 38% probability ahead of the numbers.

Still, BNP Paribas S.A. and some investors, predict the Fed will move to raise interest rates around September.

"This makes a September rate hike more probable," Mr. Serebriakov said. "It strikes against the complacency that the Fed won't be able to move at all this year."

Write to James Ramage at james.ramage@wsj.com