This treatment is known as electroconvulsive therapy (ECT)
Electroconvulsive therapy (ECT) is a procedure, in which small electric currents are passed through the brain, with the intention of triggering a brief seizure to provide relief from mental disorders. ECT may not work for everyone and it is frequently used when other treatments are unsuccessful. ECT is used to treat severe depression, catatonia and agitation and aggression in people with dementia .