This paper considers the two-way relay channel (TWRC) where two users communicate via a relay. For the restricted TWRC where the uplink from the users to the relay is any deterministic function and the downlink from the relay to the users is any arbitrary channel, the capacity region is obtained. The TWRC considered is restricted in the sense that each user can only transmit a function of its message.