This resulted in significant improvements in the relevancy recommendations and the system’s capability to self adjust in real-time. For one of the largest auto part distribution retail company, Grid Dynamics has been actively engaged in the modernization of the product catalog, which enables search and browse functionality. Our solution uses Generative AI to correct product images, generate descriptions, correct categorization, enhance attributes and highlight discrepancies in the product details. As a result, this client expects to improve customer conversion and user experiences, leading to increase in sales across both B2B and B2C channels. For a multinational financial service provider, Grid Dynamics leads a cybersecurity program to onboard over 400 custom built applications to SailPoint IdentityIQ platform.
The solution enables our client with a full lifecycle of identity and access management, ensuring proper duty separation to meet the latest security compliance standards. We expect to expand this project during the next phase and onboard another over 1000 applications to this platform. For a global automotive manufacturer, Grid Dynamics developed a cloud native e-commerce platform based on robust microservices architecture. This platform enables an intuitive end-to-end user experience and promotes in-house financing to car shoppers, which anticipates to increase the vehicle sales through the digital channel. With that, let me turn the call to Anil who will discuss Q4 results in more details. Anil?
Anil Doradla: Thanks Leonard. Good afternoon everyone. Our fourth quarter revenue of $78.1 million was slightly ahead of our guidance range of $76 million to $78 million and exceeded Wall Street expectations. On a sequential basis, our revenue grew 0.8% and was down 3.1% on a year-over-year basis. Relative to last quarter, we saw greater stabilization across the majority of our accounts. During the fourth quarter, Retail, our largest vertical, representing 31.5% of our revenues, decreased by 7.4% on a sequential basis and by 4.2% on a year-over-year basis. On a sequential basis the decline was largely from specialty retail offset by strength in home improvement, TMT, our second largest vertical, represented 31% of our fourth quarter revenues, grew 1.9% on a sequential basis and decreased by 10.9% on a year-over-year basis.
On a sequential basis, the growth was largely driven by some of the large technology customers. Here are the details of the revenue mix of other verticals. Our CPG and Manufacturing represented 12.4% of our revenue in the fourth quarter, flat on a sequential basis and decrease of 31.3% on a year-over-year basis. During the quarter, we witnessed stabilization at our largest CPG customer and growth at other customers. The finance vertical represented 10.6% of revenue, an increase of 13.4% on a sequential basis and 32.6% on a year-over-year basis. The growth in the quarter came from a combination of financial technology, customers and new logos. And finally, the Other segment represented 14.5% of our fourth quarter revenue and was up 11.5% on a sequential basis.
The sequential growth was driven by strength across multiple customers, some of them in the healthcare and restaurant industries. We exited the fourth quarter with a total headcount of 3920, versus 3823 employees in the third quarter of 2023 and up from 3798 in the fourth quarter of 2022. At the end of the fourth quarter of 2023, our U.S. headcount was 331, or 8.4% of the company’s total headcount. This remained on the same level compared to the third quarter of 2023 and slightly decreased from 8.9% in the year ago quarter. Our non-U.S. headcount located in Europe, Americas and India was 3,589, or 91.6%. In the fourth quarter, revenues from our top five and top ten customers were 39.7% and 55.3%, respectively, versus 43.2% and 60.4% in the same period a year ago, respectively.
We witnessed continuous diversification and greater contribution from our recently acquired loans. During the fourth quarter we had a total of 218 customers, down from 224 in the third quarter of 2023 and flat in the year ago quarter. The declines were largely from our commercial customers, offset by growth in our enterprise customers. Moving to the income statement, our GAAP gross profit during the quarter was $28.1 million, or 36% and remained flat compared to $28.2 million or 36.4% in the third quarter of 2023 and down from $32.3 million, or 40.1%, in the year ago quarter. On a non-GAAP basis, our gross profit was $28.6 million, or 36.6% versus $28.7 million, or 37%, in the third quarter of 2023 and down from $32.7 million, or 40.6%, in the year ago quarter.
The decrease in gross margin as a percentage on a year-over-year basis, both on a GAAP and non-GAAP basis was largely due to a combination of FX headwinds, costs associated with expansion into new geographies and other investments. Non-GAAP EBITDA during the fourth quarter that excluded stock-based compensation, depreciation and amortization, restructuring expenses related to geographic reorganization, transaction and other related costs was $10.7 million, or 13.7% of sales versus $10.7 million, or 13.9% of sales in the third quarter of 2023 and down from $16.5 million, or 20.4% of sales in the year ago quarter. The year-over-year decline in non-GAAP EBITDA as a percentage was largely due to a combination of decline in gross margins, increase in operating expenses related to acquisitions, and investments into our sales organization.
Our GAAP net income in the fourth quarter totaled $2.9 million, or $0.04 based on basic share count of 75.7 million shares, compared to the third quarter income of $0.7 million, or $0.01 based on a basic share count of 75.5 million and a loss of $6.7 million, or $0.9 per share based on 74 million basic shares in the year ago quarter. The year-over-year increase in GAAP net income was largely due to lower levels of stock-based compensation and significant decrease in geographic reorganization costs. On a non-GAAP basis, in the fourth quarter, our non-GAAP net income was $5.7 million, or $0.07 per share, based on 78 million diluted shares, compared to the third quarter, non-GAAP net income of $5.9 million, or $0.08 per share, based on 77.3 million diluted shares and $10.5 million, or $0.14 per diluted share based on 76.5 million diluted shares in the year ago quarter.
On December 31, 2023, our cash and cash equivalents totaled $257.2 million, up from $253.7 million in the third quarter of 2023. Coming to the first quarter guidance we expect revenues to be in the range of $77 million to $79 million. We expect our non-GAAP EBITDA in the first quarter to be in the range of $9.5 million to $10.5 million. For Q1 2024, we expect our basic share count to be in the 76.5 million to 77.5 million range and our diluted share count to be in the 78.5 million to 79.5 million range. That concludes my prepared remarks. Bin we are ready to take questions.