For the first time, Microsoft's market value rose above the level of $3 trillion, during Wednesday's trading, maintaining its position as the second largest company in the world in terms of value directly after Apple, supported by optimism about artificial intelligence that fuels the rapid rise of technology company stocks.

Microsoft and Apple shares are competing for first place as they are the most capitalized stocks on Wall Street since the beginning of the year, with the company that produces iPhone phones briefly losing the lead position to the software giant earlier this month.

Microsoft shares hit a record high of $405.63, an increase of 1.7 percent, breaching the $3 trillion barrier. Apple shares were trading at $195.50, an increase of 0.3 percent, bringing its market value to $3.02 trillion, according to data from the London Stock Exchange Group.

Over the past year, shares of Microsoft, which is headquartered in Redmond, Washington, rose by approximately 57 percent and increased by 7.4 percent, outperforming the 4.6 percent rise of the Nasdaq 100 index. It should be noted that Microsoft stock represents 7.3 percent of the S&P 500 index.

Microsoft is one of the giants of the seven technology companies that led the rise of the American market over the past year.

This significant rise in the giant company's shares comes in light of investors' enthusiasm for artificial intelligence and its ability to accelerate growth in both profits and revenues.

Supported by its investment in OpenAI, the creator of the chatbot (GBT), Microsoft is widely seen as the favorite in the market race to deploy generative artificial intelligence among other giant technology companies, including Alphabet, the owner of Google. Amazon.com, Oracle, and Meta Platforms, the parent company of Facebook.

By using Open AI technology, Microsoft has released newer versions of its distinguished software, in addition to its search engine (Bing), which is expected to improve its chances of competing with the dominant search engine, Google.

On the other hand, Apple is facing a decline in demand for its iPhone devices, especially in China, where the company offers its customers rare discounts to boost sales amid intense competition from local competitors such as Huawei Technologies.

I think this is (due to) Microsoft's AI support and that Apple does not seem to have a clear AI direction, coupled with concerns about iPhone sales growth rates and penetration, said Brad Reback, an analyst at Stifel Consulting and Brokerage. Data from the London Stock Exchange Group said that 54 analysts covering Microsoft shares set an average price target of $425, up from 415 a month ago, and their average recommendation was buy.

The rise of Wall Street companies to record levels will be tested in the coming weeks when giant American companies begin publishing their results.