This story was updated at 4:15 p.m. EDT.

Stocks closed mixed Wednesday, with the tech sector dragged lower by shares of Apple and Twitter, as investors digested the latest policy decision by the U.S. Federal Reserve.

Apple's shares were down 6 percent at $97.82 after the tech giant reported its first revenue decline in 13 years, while Twitter slumped 16 percent to $14.86 after its revenue missed expectations.

The U.S. Federal Reserve held interest rates unchanged at the conclusion of a two-day meeting Wednesday, but left the door ajar to a hike in June.

The U.S. central bank's policy-setting committee said the labor market had improved further despite a recent economic slowdown and that it was keeping a close eye on inflation.

The Dow Jones Industrial Average had worked off an earlier loss by the close and finished up 51 points, or 0.3 percent, at 18,042, while the Standard & Poor's 500 gained 3 points, or 0.2 percent, to close at 2,095. The tech-rich Nasdaq composite fell 25 points, or 0.5 percent, to 4,863.

Oil hit its highest level this year Wednesday, driven by a falling dollar and evidence of declining U.S. supply, putting the price on course for its strongest monthly performance since last April.

Disappointing earnings have slowed a recent rally, but the S&P 500 continues to hold near the record high it set almost a year ago. The index has rallied 15 percent since February.

First-quarter earnings from S&P 500 components are expected to have fallen 7.1 percent from a year earlier, according to Thomson Reuters I/B/E/S. Of the 166 companies that have reported, 59 percent reported revenue above analyst expectations, just short of the average 60 percent since 2002.

Facebook shares were up 7 percent in after-hours trading following news that the social media site reported a 51.9 percent rise in quarterly revenue as its increasingly popular mobile app and push into live video continued to attract new advertisers and encouraged existing ones to boost spending.

DreamWorks Animation rose 19 percent to $32.20 after the Wall Street Journal reported Comcast was in talks to buy the Hollywood studio owner. Comcast was up 0.4 percent.

EBay was up 3 percent at $25.27 after raising its full-year revenue forecast, while Boeing rose 3 percent to $137.06 despite a drop in quarterly profit.

Chipotle was down 6 percent at $417.22 after a bigger-than-expected drop in quarterly comparable sales prompted a spate of price target cuts.

Data from Reuters were used to report this story.