US stocks ended the week on a high note, with all three major indexes posting gains on Friday. The Dow Jones closed above 40,000 for only the second time in history, though it finished just over 2 points shy of a record high.

The S&P 500 rose by 0.5%, the Nasdaq Composite increased by 0.6%, and the Dow Jones Industrial Average also gained 0.6% on Friday, securing a 1.6% weekly gain for the Dow. Despite Thursday’s tech sell-off, the Nasdaq managed a 0.2% weekly increase, while the S&P 500 saw a 0.9% rise for the week.

Friday’s gains came on the heels of strong earnings reports from Wall Street banks. JPMorgan Chase reported a 25% surge in second-quarter profit, driven by higher investment banking fees and an $8 billion one-time gain from Visa, though its shares dipped.

Wells Fargo’s stock dropped nearly 6% after the bank reported a decline in profit and missed interest income estimates. Meanwhile, Citi’s stock fell over 1% despite a 10% profit increase, as it maintained a modestly lower net interest income outlook for 2024.