The present invention provides a substrate processing apparatus that
executes electrical discharge processing before detaching a substrate
held onto an electrostatic chuck of a lower electrode constituting a
stage and undergoing a specific type of processing from the electrostatic
chuck. Before electrically discharging the substrate, a decision is made
as to whether or not the specific type of processing on the substrate has
ended normally, and electrical discharge conditions are set based upon
regular electrical discharge condition information stored at a regular
electrical discharge condition information storage means if the substrate
processing is judged to have ended normally, whereas electrical discharge
conditions are set based upon non-regular electrical discharge condition
information stored at a non-regular electrical discharge condition
information storage means if the substrate processing is judged not to
have ended normally. Then, under the electrical discharge conditions
having been set, electrical discharge processing is executed on the
substrate.