A method for controlling a portable device using an electric pen, the method comprising: forming an electric or magnetic field by a sensing unit of the portable device; sensing a touch or hovering operation of the electric pen within a sensing range of the portable device by at least one of sensing a change in one of a size, a frequency, or a resonance frequency of the electric or magnetic field, or based on a wireless signal from the electric pen; wherein the touch operation corresponds to a state where the electric pen contacts a display unit of the portable device; wherein the sensing range is a distance up to which the electric pen is sensed; sensing, while the touch or hovering operation is sensed, a pushed state of a button on the electric pen by at least one of sensing a second change of one of the size, the frequency, or the resonance frequency of the electric or magnetic field, or based on the wireless signal from the electric pen; performing a first control operation corresponding to the sensing of the pushed state of the button; performing a second control operation of the portable device in response to sensing a separation of the electric pen from the portable device, out of the sensing range, in a state in which the button is maintained in the pushed state, by at least one of sensing a third change of one of the size, the frequency or the resonance frequency of the electric or magnetic field, or based on the wireless signal from the electric pen, wherein the second control operation is performed after a preset time has passed from a time when the separation has been sensed; wherein the second control operation corresponds to at least one of terminating an application under operation, displaying a predetermined screen, entering a locking mode or a power save mode according to the displayed screen, wherein entering the power save mode may comprise stopping the power supply to components of the portable device other than the input sensing unit. forming an electric or magnetic field by a sensing unit of the portable device; sensing a touch or hovering operation of the electric pen within a sensing range of the portable device by at least one of sensing a change in one of a size, a frequency, or a resonance frequency of the electric or magnetic field, or based on a wireless signal from the electric pen; wherein the touch operation corresponds to a state where the electric pen contacts a display unit of the portable device; wherein the sensing range is a distance up to which the electric pen is sensed; sensing, while the touch or hovering operation is sensed, a pushed state of a button on the electric pen by at least one of sensing a second change of one of the size, the frequency, or the resonance frequency of the electric or magnetic field, or based on the wireless signal from the electric pen; performing a first control operation corresponding to the sensing of the pushed state of the button; performing a second control operation of the portable device in response to sensing a separation of the electric pen from the portable device, out of the sensing range, in a state in which the button is maintained in the pushed state, by at least one of sensing a third change of one of the size, the frequency or the resonance frequency of the electric or magnetic field, or based on the wireless signal from the electric pen, wherein the second control operation is performed after a preset time has passed from a time when the separation has been sensed; wherein the second control operation corresponds to at least one of terminating an application under operation, displaying a predetermined screen, entering a locking mode or a power save mode according to the displayed screen, wherein entering the power save mode may comprise stopping the power supply to components of the portable device other than the input sensing unit.