An LED lamp suitable for use in a luminaire, the LED lamp comprising: a first pair of connectors at a first end of the LED lamp, a second pair of connectors at a second end of the LED lamp, wherein the LED lamp is configured to receive electrical power from the luminaire via the first pair and the second pair of connectors; a rectifier at each end of the first end and the second end configured to rectify the received electrical power and to supply a rectified voltage or current to the LED lamp; one or more LEDs; a ballast protection circuit including an impedance, the ballast protection circuit connectable in series with the one or more LEDs; a switched-mode power supply connected to the one or more LEDs for driving the one or more LEDs; a filter circuit connectable for filtering noise generated by the switched-mode power supply; a switching circuit comprising sensing circuits arranged for generating at least one output, in dependence on whether the electrical power received from the luminaire or the rectified voltage or current supplied to the LED lamp indicates that the electrical power is provided via a magnetic ballast, an electronic ballast which operates as a constant current ballast, an electronic ballast which operates as a constant power ballast, or not via a ballast; and the LED lamp being characterized in that the switching circuit is arranged for switching among a plurality of operation modes in dependence on the at least one output from the sensing circuits, wherein the plurality of operation modes comprise: a first operation mode, in which the switched-mode power supply operates at an operation frequency, the filter circuit is connected for filtering noise generated by the switched-mode power supply, and the ballast protection circuit is disconnected; a second operation mode, in which the switched-mode power supply does not operate, the filter circuit is disconnected, the ballast protection circuit is connected, and the impedance is bypassed; and a third operation mode, in which the switched mode power supply does not operate, the filter circuit is disconnected, the ballast protection circuit is connected, and the impedance is connected in series with the LEDs. a first pair of connectors at a first end of the LED lamp, a second pair of connectors at a second end of the LED lamp, wherein the LED lamp is configured to receive electrical power from the luminaire via the first pair and the second pair of connectors; a rectifier at each end of the first end and the second end configured to rectify the received electrical power and to supply a rectified voltage or current to the LED lamp; one or more LEDs; a ballast protection circuit including an impedance, the ballast protection circuit connectable in series with the one or more LEDs; a switched-mode power supply connected to the one or more LEDs for driving the one or more LEDs; a filter circuit connectable for filtering noise generated by the switched-mode power supply; a switching circuit comprising sensing circuits arranged for generating at least one output, in dependence on whether the electrical power received from the luminaire or the rectified voltage or current supplied to the LED lamp indicates that the electrical power is provided via a magnetic ballast, an electronic ballast which operates as a constant current ballast, an electronic ballast which operates as a constant power ballast, or not via a ballast; and the LED lamp being characterized in that the switching circuit is arranged for switching among a plurality of operation modes in dependence on the at least one output from the sensing circuits, wherein the plurality of operation modes comprise: a first operation mode, in which the switched-mode power supply operates at an operation frequency, the filter circuit is connected for filtering noise generated by the switched-mode power supply, and the ballast protection circuit is disconnected; a second operation mode, in which the switched-mode power supply does not operate, the filter circuit is disconnected, the ballast protection circuit is connected, and the impedance is bypassed; and a third operation mode, in which the switched mode power supply does not operate, the filter circuit is disconnected, the ballast protection circuit is connected, and the impedance is connected in series with the LEDs. a first operation mode, in which the switched-mode power supply operates at an operation frequency, the filter circuit is connected for filtering noise generated by the switched-mode power supply, and the ballast protection circuit is disconnected; a second operation mode, in which the switched-mode power supply does not operate, the filter circuit is disconnected, the ballast protection circuit is connected, and the impedance is bypassed; and a third operation mode, in which the switched mode power supply does not operate, the filter circuit is disconnected, the ballast protection circuit is connected, and the impedance is connected in series with the LEDs.