A method, on a first UE, for managing transmit power in device-to-device communication and cellular communication, the method comprising: establishing a connection with a first cell, such that the first cell configures the first UE for Carrier Aggregation, CA, by giving the first UE a CA configuration including which cell is to function as a second cell, determining a first configured maximum output power, wherein the first configured maximum output power is based on a configuration of the first cell; determining a second configured maximum output power, wherein the second configured maximum output power is based on the configuration of the first cell and a configuration of the second cell; determining whether a total transmit power would exceed the second configured maximum output power; and when it is determined that the total transmit power would exceed the second configured maximum output power, performing steps comprising: determining a cellular transmit power based on one or more of a plurality of factors, the plurality comprising the first configured maximum output power, the second configured maximum output power, and a relative priority of service of device-to-device communication and cellular communication; transmitting a cellular signal on a carrier of the first cell at the determined cellular transmit power; determining a device-to-device transmit power based on one or more of a plurality of factors, the plurality comprising the first configured maximum output power, the second configured maximum output power, and a relative priority of service of device-to-device communication and cellular communication; requesting permission to engage in device-to-device communication with a second UE, such that the first UE and the second UE are allocated time-frequency resources of a carrier on the second cell; and transmitting a device-to-device signal to the second UE on the carrier of the second cell at the determined device-to-device transmit power. establishing a connection with a first cell, such that the first cell configures the first UE for Carrier Aggregation, CA, by giving the first UE a CA configuration including which cell is to function as a second cell, determining a first configured maximum output power, wherein the first configured maximum output power is based on a configuration of the first cell; determining a second configured maximum output power, wherein the second configured maximum output power is based on the configuration of the first cell and a configuration of the second cell; determining whether a total transmit power would exceed the second configured maximum output power; and when it is determined that the total transmit power would exceed the second configured maximum output power, performing steps comprising: determining a cellular transmit power based on one or more of a plurality of factors, the plurality comprising the first configured maximum output power, the second configured maximum output power, and a relative priority of service of device-to-device communication and cellular communication; transmitting a cellular signal on a carrier of the first cell at the determined cellular transmit power; determining a device-to-device transmit power based on one or more of a plurality of factors, the plurality comprising the first configured maximum output power, the second configured maximum output power, and a relative priority of service of device-to-device communication and cellular communication; requesting permission to engage in device-to-device communication with a second UE, such that the first UE and the second UE are allocated time-frequency resources of a carrier on the second cell; and transmitting a device-to-device signal to the second UE on the carrier of the second cell at the determined device-to-device transmit power. determining a cellular transmit power based on one or more of a plurality of factors, the plurality comprising the first configured maximum output power, the second configured maximum output power, and a relative priority of service of device-to-device communication and cellular communication; transmitting a cellular signal on a carrier of the first cell at the determined cellular transmit power; determining a device-to-device transmit power based on one or more of a plurality of factors, the plurality comprising the first configured maximum output power, the second configured maximum output power, and a relative priority of service of device-to-device communication and cellular communication; requesting permission to engage in device-to-device communication with a second UE, such that the first UE and the second UE are allocated time-frequency resources of a carrier on the second cell; and transmitting a device-to-device signal to the second UE on the carrier of the second cell at the determined device-to-device transmit power.