Caspofungin is an antifungal medication belonging to the class of echinocandins. It is primarily used to treat serious fungal infections, particularly those caused by Candida and Aspergillus species. Caspofungin works by inhibiting the synthesis of β-(1,3)-D-glucan, an essential component of the fungal cell wall, thereby leading to cell death.