Who said to sell in May and go away? U.S. equities may have ended Wednesday's session lower, but Wall Street still posted gains for the month. 

The S&P 500 dropped 0.05% on Wednesday, the Dow Jones Industrial Average fell 0.11%, and the Nasdaq slid 0.08% -- despite hitting an intraday record high shortly after opening.

For the month of May overall, the S&P 500, Dow, and Nasdaq each increased. It was the S&P 500's second month of gains in a row and its best month since February. The Nasdaq fared even better, rising for seven months in a row. 

The reason?  

"Everybody's always tempted to use the [Alan] Greenspan phrase "irrational exuberance," and that's what it is," Euler Hermes North America chief economist Dan North said in a call. "Stocks run on emotions, and they're running on optimism and hope for the pro-growth Trump agenda."

Markets rose even as Donald Trump's presidency faced increased scrutiny into his campaign's ties with Russia. In just the past month, Trump fired former FBI Director James Comey, who had been leading the Russia investigation; met with Russian officials and divulged classified intelligence, and news organizations reported that his son-in-law Jared Kushner had been involved in potentially unlawful discussions with foreign parties. On top of that, comments made during a nine-day trip to the Middle East and Europe appear to have alienated some of the U.S.'s closest allies. 

Still, a pro-business agenda appears to have given investors confidence  enough to push the markets to records. The S&P 500 hit an all-time intraday record of 2,418.71 on May 25 and an all-time record close of 2,415 the day after. 

"Even though there's a great deal of concern [the Trump agenda has] derailed, equities run on optimism and there's still thinking that it might happen," added North. "You're also getting strong earnings growth, so that is helping support it."

Earnings were a large contributor to growth in May, which was near the end of the first-quarter reporting season. Of the nearly 99% of S&P 500 companies that had reported by the end of the month, the majority beat earnings and sales estimates. S&P 500 earnings grew 13.7% over the quarter, swinging from 6.6% earnings contraction in the year-ago quarter. 

Crude oil prices had a rough month, with Wednesday's losses driving a steep decline.

West Texas Intermediate for July delivery ended 2.7% lower at $48.32 a barrel on growing worries over global oversupply. Libya's oil production is anticipated to increase to 800,000 barrels a day this year, according to the Tripoli-based National Oil Corporation. Libyan output currently sits at 794,000 barrels a day. Production at the country's largest oil field recently returned to higher levels after a technical issue was resolved. 

Oil has been under pressure since the Organization of Petroleum Exporting Countries made an expected move to extend its output-cut agreement by another nine months, but failed to enact further price-stabilizing measures.

Shares of Michael Kors were crushed Wednesday.
Shares of Michael Kors were crushed Wednesday.

The U.S. economy continued to grow at a "modest or moderate" pace from early April through to late May, according to the Fed's "Beige Book," an anecdotal reading on how the 12 Fed districts have fared over the past six weeks. Some regions did experience slower growth and less optimism, however. The labor market remains a bright spot with more signs of labor shortages and wage growth trending higher. 

The financials sector was lower during Wednesday's session, retreating from the highs that had propelled markets since Trump's surprise presidential election victory in November. The Financial Select Sector SPDR ETF (XLF - Get Report) rose more than 16% from the day after Trump's election through Tuesday's close, compared with the S&P 500's nearly 13% increase. The SPDR ETF declined by 0.9% on Wednesday, while Goldman Sachs (GS - Get Report) and JPMorgan (JPM - Get Report) led losses on the Dow. 

The U.S. jobs report on Friday is on watch in this holiday-shortened week. The nonfarm payrolls report for May is expected to demonstrate continued strength in the labor market, with as many as 175,000 jobs added in May, while the unemployment rate is forecast to hold at 4.4%, according to FactSet estimates. Hourly earnings are anticipated to have risen 0.2% in May.

The employment report likely won't sway the Fed's decision on interest rates at its June meeting, but could influence the pace of hikes for the rest of the year. The Federal Open Market Committee, the monetary policy arm of the central bank, is set to meet June 13-14.

Markets already have high expectations for an interest-rate increase then, the second of three expected this year. Wall Street has priced in a nearly 89% chance of a 25-basis-point boost, according to CME Group fed funds futures.

Inflation trends have been uneven, but they are not deteriorating, Dallas Fed President Robert Kaplan said in comments at the C. Peter McColough Series on International Economics in New York. On Tuesday, Kaplan said that the Fed can continue to raise interest rates while also reducing its balance sheet this year. Kaplan, a voting member of the FOMC, anticipates two more interest-rate hikes this year.

Economic conditions in the Chicago area actually rose in May, according to the Institute for Supply Management, which erroneously posted a decrease earlier Wednesday. Chicago PMI increased to 59.4, its highest level in two-and-a-half years, from 58.3 in April. Chicago PMI was originally reported as falling to a four-month low of 55.2. 

Pending home sales slid in April as tight demand hampered sales, which declined by 1.3% in April from March, according to the National Association of Realtors. Year over year, sales declined by 3.3%. Sales were expected to increase 0.5% in April. 

Michael Kors (KORS)  was the worst performer on the S&P 500 after a fourth-quarter loss of $26.8 million, or 17 cents a share, compared with earnings of $177 million, or 98 cents a share, a year earlier. Michael Kors booked a $193.8 million impairment charge tied to weak performances from certain retail locations.

Adjusted earnings of 73 cents a share came in 3 cents higher than estimates. Revenue of $1.06 billion also beat consensus of $1.05 billion. CEO John Idol said in a statement that "fiscal 2017 was a challenging year, as we continued to operate in a difficult retail environment with elevated promotional levels." Idol also conceded that the company's "product and store experience" did not engage consumers. 

The handbag and accessories retailer anticipates first-quarter earnings between 60 cents and 64 cents a share, below estimates of 79 cents. 

Meet the Millennial Media Moguls

Planning to be in New York on Tuesday, June 13? You're invited to join us for an evening of cocktails and conversation with three dynamic young CEOs whose companies have found big news audiences and good markets. How have they done it? What have they learned? Meet Chris Altchek, CEO and co-founder of Mic; Shafqat Islam, co-founder and CEO of NewsCred; and Kathryn Minshew, the CEO and co-founder of TheMuse. Our panel discussion will be led by Ken Doctor, media analyst and columnist for TheStreet. The event, from 6 to 8 p.m. is free, but space is limited and reservations are required. Please click here to RSVP and get more information.

Click here for the latest business headlines.

Watch more of TheStreet's latest videos: