Ulster Rugby's Chief Executive Michael Reid, is delighted to have reached the agreement with one of Ulster and Irish rugby's most talented backs.
"The fact that Andrew is prepared to put pen to paper at this stage in the season shows his huge commitment to Ulster Rugby and I would also like to thank the IRFU for their assistance in helping to secure the new deal," Reid said.
"While results this season have not been as hoped, Andrew's re-signing emphasises Ulster's desire to continue to develop our homegrown talent and ensuring that top quality players are attracted to the club."
Ulster head coach Matt Williams added: "Andrew is not only an accomplished rugby player, both at club and international level, but a man of the highest calibre.
"He has a natural ability and pace to his game and I'm delighted that he has chosen to give the best years of his career to Ulster. Andrew's commitment to Ulster when we are not on winning form is a real boost to the team and the supporters.
"He is a player that can naturally fit into different field positions - he is comfortable both at centre and on the wing, which is great from a coaching point of view as it opens up opportunities and partnerships that maybe not have been possible otherwise.
"He also brings both experience and confidence to the centre partnership and a great team spirit to the Ulster camp so I'm really pleased to have him on board for another two seasons."
Commenting on his decision to sign a new deal, Trimble said: "I'm glad to be staying with Ulster for the foreseeable future, it means a lot to me to play in the Ulster jersey and in front of the Ulster supporters, who are the most passionate I have experienced and are really supportive of the team.
"I'm very settled here and enjoy playing with the squad. It's made up of a great bunch of lads.
"There is a really talented group of players in the Ulster squad and although we have not been winning at the minute, we are all very committed and optimistic about the future success of Ulster."