Craig E. Boelte
Chief Financial Officer at Paycom Software
Before I review our second quarter 2021 results and our outlook for the third quarter and full-year 2021, I would like to remind everyone that my comments related to certain financial measures will be on a non-GAAP basis. We're very pleased with our second quarter results with total revenues of $242.1 million, representing growth of 33.3% over the comparable prior year period, driven primarily by broad-based strength with new client wins and consistent cross-selling to existing clients.
Within total revenues, recurring revenue was $237.6 million for the second quarter of 2021, representing 98% of total revenues for the quarter and growing 33.5% from the comparable prior year period. Total adjusted gross profit for the second quarter was $206.9 million, representing an adjusted gross margin of 85.4%.
For 2021, we remain on target for adjusted gross margin to be in the range of 85% to 86%. Adjusted total administrative expenses were $136 million for the second quarter, as compared to $106 million in the second quarter of 2020.
Adjusted sales and marketing expense for the second quarter of 2021 was $64.3 million or 26.6% of revenues. Our marketing strategy continues to generate strong demo leads both within and outside our historical target market range of 50 to 5,000 employees. We plan to continue to invest in marketing throughout the remainder of 2021. And as Chad mentioned, we have increased our target market range to 50 to 10,000, thus empowering our outside sales representatives to proactively target larger companies.
Adjusted R&D expense was $26.2 million in the second quarter of 2021 or 10.8% of total revenues. Adjusted total R&D cost including the capitalized portion were $38 million in the second quarter of 2021, compared to $27.7 million in the prior year period. We continue to be very pleased with the high-quality innovation we're seeing from our investments in R&D and we'll continue to aggressively recruit talent in R&D to drive our future growth.
Adjusted EBITDA was $87 million in the second quarter of 2021 or 35.9% of total revenues, compared to $61.2 million in the second quarter of 2020, or 33.7% of total revenues. Our GAAP net income for the second quarter was $52.3 million or $0.90 per diluted share, versus $28.6 million or $0.49 per diluted share in the prior year period based on approximately 58 million shares in both periods. Non-GAAP net income for the second quarter of 2021 was $56.5 million or $0.97 per diluted share, versus $35.9 million or $0.62 per diluted share in the prior year period.
We expect non-cash stock-based compensation for the third quarter of 2021 to be approximately $25 million to $26 million. For the full-year we anticipate non-cash stock-based compensation will be approximately $95 million to $100 million. For 2021, we anticipate our full-year effective income tax rate to be 24% to 25% on a GAAP basis. On a non-GAAP basis, we anticipate our full-year effective income tax rate to be 26% to 27%.
Turning to the balance sheet. We ended the second quarter of 2021 with cash and cash equivalents of $202.4 million and total debt of $30 million related to construction at our corporate headquarters. Cash from operations was $57 million for the second quarter, reflecting our strong revenue performance and the profitability of our business model. The average daily balance of funds held on behalf of clients was approximately $1.6 billion in the second quarter of 2021.
During the second quarter of 2021, we repurchased approximately 94,000 shares for a total of roughly $32 million. For June 30, 2021 Paycom has repurchased over 4.2 million shares, since 2016 for a total of approximately $455 million, while we currently have roughly $300 million remaining in our buyback program.
Shifting to guidance. We are pleased to provide strong third quarter guidance that reflects the robust performance we achieved in the first half of 2021 and we are raising our full-year 2021 outlook as a result. Our Q3 and full-year guidance are as follows: For the third quarter of 2021, we expect total revenues in the range of $249 million to $251 million, representing a growth rate over the comparable prior year period of approximately 27% at the midpoint of the range. We expect adjusted EBITDA for the third quarter in the range of $87 million to $89 million, representing an adjusted EBITDA margin of approximately 35.2% at the midpoint of the range.
For fiscal 2021, we are raising our expected revenue range to $1.036 billion to $1.038 billion, up from $1.017 billion to $1.019 billion, or approximately 23.2% year-over-year growth at the midpoint of the range. We expect full-year adjusted EBITDA in the range of $410 million to $412 million, representing an adjusted EBITDA margin of approximately 39.6% at the midpoint of the range. When combined, we now expect revenue growth and adjusted EBITDA margin to easily exceed the rule of 60 this year.
To conclude, we are very pleased with the performance in the quarter, which gives us increasing confidence in our outlook for the remainder of the year. With the launch of Beti and expanded target market and a deep product development pipeline, we have a long runway ahead of us to continue to deliver rapid growth for years to come.
With that, we will open the line for questions. Operator?