Financial stocks led the way, as the momentum in Washington for an overhaul of bank regulations held up in advance of a preliminary vote on Thursday.
The Dow Jones climbed 37.46 points or 0.18% to 21,173.69. The wider S&P 500 added 2.81 points, rising 0.16% to 2,433.09.
The Nasdaq closed up 0.34% at 6,296.70.
Trade volume lessened, as investors trod with caution ahead of the UK general election and former FBI director James Comey's testimony in Washington on Thursday.
Some of the impact of that testimony was blunted by the release of his prepared remarks, which repeated already available information.
Energy stocks fared the worst on Wednesday, as oil prices slid following a new report that showed a rise in US production.
Financial firms were among the biggest risers.
The US House of Representatives is expected to approve a bill on Thursday that would undo many of the financial rules put in place after the 2008 crisis.
Few expect the proposal in its current form to advance from the House into law, but they say its support is a sign that a more limited reform could succeed.
The Federal Reserve also said three major banks, including Deutsche Bank and UBS Group, would be given more time to comply with one of those financial rules.
Bank of America shares closed the day up 1.66%, JP Morgan Chase gained 1.15%, Deutsche added 0.75% and Goldman Sachs rose 0.58%.

She will play Denker, a lady's maid to Dame Maggie Smith's character, the Dowager Countess of Grantham.
Johnston, who has also appeared in Waking the Dead and Coronation Street, joins new stars Richard E Grant and Anna Chancellor, both of whom will play guests of the Granthams at Downton.
The hit period drama will return to screens this autumn.
Series four of the show, which followed the wealthy Grantham family and their servants, achieved an average of 11.9 million viewers in the UK.
The very British drama has also been a huge hit in the US, winning both Emmy Awards and Golden Globes.
More than 26 million viewers watched series four on Masterpiece on PBS, making it one of the highest rating shows on American television.
Previous high profile guest stars include Shirley Maclaine who played Martha Levinson, Lady Grantham's mother, and Oscar-nominated actor Paul Giamatti who appeared in last year's Christmas special as her "maverick, playboy" son.
Series five will also feature 24 star Rade Sherbedgia as a Russian refugee who has fled the revolution after World War 1.
Earlier this year, executive producer Gareth Neame promised it would have "all the usual highs and lows, romance, drama and comedy".
Shares on Wall Street closed higher on Wednesday, recovering ground after a fall on Tuesday.
[NEXT_CONCEPT]
The Royle Family actress Sue Johnston is the latest star to join series five of ITV's Downton Abbey in a guest role.