Gabapentin is a prescription medication primarily used to treat certain types of nerve pain and as an anticonvulsant for managing seizures. It was initially developed to treat epilepsy but has since found broader uses.