* Energy leads gain
* Indexes: Dow down 0.5 pct, S&P up 0.7 pct, Nasdaq up 0.6 pct (Updates to late afternoon)
By Caroline Valetkevitch
NEW YORK, Dec 19 (Reuters) - U.S. stocks gained ground in late afternoon trading on Friday, extending the S&P 500's best two-day run in more than three years, helped by higher energy shares.
The S&P 500 was within points of a fresh intraday record high and, with gains of more than 3 percent this week, the index was also on track for its best weekly performance in two months.
It has erased nearly all the losses from the prior week, which were tied to a sharp drop in oil prices.
The day's gains follow a 4.5 percent rally over the previous two sessions, spurred by the U.S. Federal Reserve's commitment to take a "patient" approach toward raising interest rates, while signaling it was on track to boost rates in 2015.
The news provided both clarity and relief to investors over the policy outlook, analysts said.
Brent crude oil rebounded to end up 3.6 percent at $61.38 a barrel, while WTI crude jumped 4.5 percent to settled at $56.52. The S&P energy index was up 2.3 percent, leading the benchmark index's advance.
Among decliners, shares of Nike shed 2.8 percent, a day after the company flagged slowing growth in western Europe.
At 3:14 p.m., the Dow Jones industrial average rose 79.15 points, or 0.45 percent, to 17,857.3, the S&P 500 gained 14.32 points, or 0.69 percent, to 2,075.55 and the Nasdaq Composite added 28.07 points, or 0.59 percent, to 4,776.47.
Quadruple witching - the expiration of stock options, index options, index futures and single-stock futures - may be adding to the day's volatility, along with the rebalancing of the S&P 500, scheduled to take effect after the close.
Shares of Red Hat surged 10.9 percent after it raised its profit forecast for the full year and reported quarterly revenue and profit that beat expectations.
Advancing issues outnumbered decliners on the NYSE 2,136 to 941, for a 2.27-to-1 ratio; on the Nasdaq, 1,542 issues rose and 1,182 fell for a 1.30-to-1 ratio.
The benchmark S&P 500 was posting 107 new 52-week highs and 5 new lows; the Nasdaq Composite was recording 115 new highs and 41 new lows. (Editing by Bernadette Baum and Nick Zieminski)